aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/server.cpp
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2017-09-07 17:20:26 -0400
committerRussell Yanofsky <russ@yanofsky.org>2017-10-03 15:25:00 -0400
commitedafc718ad071993d10b3b9a1e1828bbd1f8ce54 (patch)
tree9b6f737f70a6f2e4a090e1fb9626d2706bb24dee /src/rpc/server.cpp
parentb4a509a3f817121c3df98ddfd96b2769e18a3e5a (diff)
downloadbitcoin-edafc718ad071993d10b3b9a1e1828bbd1f8ce54.tar.xz
Fix uninitialized URI in batch RPC requests
This fixes "Wallet file not specified" errors when making batch wallet RPC calls with more than one wallet loaded. This issue was reported by NicolasDorier <nicolas.dorier@gmail.com> https://github.com/bitcoin/bitcoin/issues/11257 Request URI is not used for anything except multiwallet request dispatching, so this change has no other effects. Fixes #11257
Diffstat (limited to 'src/rpc/server.cpp')
-rw-r--r--src/rpc/server.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp
index a73b697e01..39bcfc6903 100644
--- a/src/rpc/server.cpp
+++ b/src/rpc/server.cpp
@@ -389,11 +389,10 @@ bool IsDeprecatedRPCEnabled(const std::string& method)
return find(enabled_methods.begin(), enabled_methods.end(), method) != enabled_methods.end();
}
-static UniValue JSONRPCExecOne(const UniValue& req)
+static UniValue JSONRPCExecOne(JSONRPCRequest jreq, const UniValue& req)
{
UniValue rpc_result(UniValue::VOBJ);
- JSONRPCRequest jreq;
try {
jreq.parse(req);
@@ -413,11 +412,11 @@ static UniValue JSONRPCExecOne(const UniValue& req)
return rpc_result;
}
-std::string JSONRPCExecBatch(const UniValue& vReq)
+std::string JSONRPCExecBatch(const JSONRPCRequest& jreq, const UniValue& vReq)
{
UniValue ret(UniValue::VARR);
for (unsigned int reqIdx = 0; reqIdx < vReq.size(); reqIdx++)
- ret.push_back(JSONRPCExecOne(vReq[reqIdx]));
+ ret.push_back(JSONRPCExecOne(jreq, vReq[reqIdx]));
return ret.write() + "\n";
}