aboutsummaryrefslogtreecommitdiff
path: root/src/rest.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2016-10-19 15:01:33 +0200
committerWladimir J. van der Laan <[email protected]>2016-10-19 15:15:49 +0200
commit97c7f7362f9b59247753d6e8fa8022a6205f9c09 (patch)
tree19dcb95789fea3e6d168a7b2e1ecb7d66a5e006f /src/rest.cpp
parentMerge #8972: [Qt] make warnings label selectable (jonasschnelli) (diff)
parent[RPC] pass HTTP basic authentication username to the JSONRequest object (diff)
downloaddiscoin-97c7f7362f9b59247753d6e8fa8022a6205f9c09.tar.xz
discoin-97c7f7362f9b59247753d6e8fa8022a6205f9c09.zip
Merge #8788: [RPC] Give RPC commands more information about the RPC request
e7156ad [RPC] pass HTTP basic authentication username to the JSONRequest object (Jonas Schnelli) 69d1c25 [RPC] Give RPC commands more information about the RPC request (Jonas Schnelli) 23c32a9 rpc: Change JSONRPCRequest to JSONRPCRequestObj (Wladimir J. van der Laan)
Diffstat (limited to 'src/rest.cpp')
-rw-r--r--src/rest.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rest.cpp b/src/rest.cpp
index c81559212..b8b542062 100644
--- a/src/rest.cpp
+++ b/src/rest.cpp
@@ -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,9 @@ 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;
+ jsonRequest.params = UniValue(UniValue::VARR);
+ UniValue chainInfoObject = getblockchaininfo(jsonRequest);
string strJSON = chainInfoObject.write() + "\n";
req->WriteHeader("Content-Type", "application/json");
req->WriteReply(HTTP_OK, strJSON);