mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
[RPC] Give RPC commands more information about the RPC request
This commit is contained in:
@@ -274,7 +274,7 @@ static bool rest_block_notxdetails(HTTPRequest* req, const std::string& strURIPa
|
||||
}
|
||||
|
||||
// A bit of a hack - dependency on a function defined in rpc/blockchain.cpp
|
||||
UniValue getblockchaininfo(const UniValue& params, bool fHelp);
|
||||
UniValue getblockchaininfo(const JSONRPCRequest& request);
|
||||
|
||||
static bool rest_chaininfo(HTTPRequest* req, const std::string& strURIPart)
|
||||
{
|
||||
@@ -285,8 +285,8 @@ static bool rest_chaininfo(HTTPRequest* req, const std::string& strURIPart)
|
||||
|
||||
switch (rf) {
|
||||
case RF_JSON: {
|
||||
UniValue rpcParams(UniValue::VARR);
|
||||
UniValue chainInfoObject = getblockchaininfo(rpcParams, false);
|
||||
JSONRPCRequest jsonRequest;
|
||||
UniValue chainInfoObject = getblockchaininfo(jsonRequest);
|
||||
string strJSON = chainInfoObject.write() + "\n";
|
||||
req->WriteHeader("Content-Type", "application/json");
|
||||
req->WriteReply(HTTP_OK, strJSON);
|
||||
|
||||
Reference in New Issue
Block a user