| 715 | RPCMethod getblockchaininfo(); |
| 716 | |
| 717 | static bool rest_chaininfo(const std::any& context, HTTPRequest* req, const std::string& uri_part) |
| 718 | { |
| 719 | if (!CheckWarmup(req)) |
| 720 | return false; |
| 721 | std::string param; |
| 722 | const RESTResponseFormat rf = ParseDataFormat(param, uri_part); |
| 723 | |
| 724 | switch (rf) { |
| 725 | case RESTResponseFormat::JSON: { |
| 726 | JSONRPCRequest jsonRequest; |
| 727 | jsonRequest.context = context; |
| 728 | jsonRequest.params = UniValue(UniValue::VARR); |
| 729 | UniValue chainInfoObject = getblockchaininfo().HandleRequest(jsonRequest); |
| 730 | std::string strJSON = chainInfoObject.write() + "\n"; |
| 731 | req->WriteHeader("Content-Type", "application/json"); |
| 732 | req->WriteReply(HTTP_OK, strJSON); |
| 733 | return true; |
| 734 | } |
| 735 | default: { |
| 736 | return RESTERR(req, HTTP_NOT_FOUND, "output format not found (available: json)"); |
| 737 | } |
| 738 | } |
| 739 | } |
| 740 | |
| 741 | |
| 742 | RPCMethod getdeploymentinfo(); |
nothing calls this directly
no test coverage detected