aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/server.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-03-03 13:37:19 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2017-03-03 13:38:42 +0100
commiteb281842b7df099494982b1c4d45d02520ae278c (patch)
tree11253973862b7fe7354273aa76376cf25f8d1374 /src/rpc/server.cpp
parent58861ad91b499f6902c0f1c51bb745b91a275826 (diff)
parentd678771c660c936a6222dd43a204cb2699100f3e (diff)
downloadbitcoin-eb281842b7df099494982b1c4d45d02520ae278c.tar.xz
Merge #8775: RPC refactoring: Access wallet using new GetWalletForJSONRPCRequest
d678771 Wallet: Sanitise -wallet parameter (Luke Dashjr) 9756be3 Wallet/RPC: Use filename rather than CWallet pointer, for lockwallet RPCRunLater job name (Luke Dashjr) 86be48a More tightly couple EnsureWalletIsAvailable with GetWalletForJSONRPCRequest where appropriate (Luke Dashjr) a435632 Move wallet RPC declarations to rpcwallet.h (Luke Dashjr) ad15734 RPC: Pass on JSONRPCRequest metadata (URI/user/etc) for "help" method (Luke Dashjr) bf8a04a Reformat touched lines with C++11 (Luke Dashjr) 2e518e3 Move nWalletUnlockTime to CWallet::nRelockTime, and name timed task unique per CWallet (Luke Dashjr) d77ad6d RPC: Do all wallet access through new GetWalletForJSONRPCRequest (Luke Dashjr) eca550f RPC/Wallet: Pass CWallet as pointer to helper functions (Luke Dashjr) Tree-SHA512: bfd592da841693390e16f83b451503eb5cedb71208089aa32b3fc45e973555584a3ed7696dd239f6409324464d565dacf0f3d0e36e8e13ae6a7843848465f960
Diffstat (limited to 'src/rpc/server.cpp')
-rw-r--r--src/rpc/server.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp
index 0d29f245ae..f418d71e71 100644
--- a/src/rpc/server.cpp
+++ b/src/rpc/server.cpp
@@ -178,7 +178,7 @@ vector<unsigned char> ParseHexO(const UniValue& o, string strKey)
* Note: This interface may still be subject to change.
*/
-std::string CRPCTable::help(const std::string& strCommand) const
+std::string CRPCTable::help(const std::string& strCommand, const JSONRPCRequest& helpreq) const
{
string strRet;
string category;
@@ -189,16 +189,19 @@ std::string CRPCTable::help(const std::string& strCommand) const
vCommands.push_back(make_pair(mi->second->category + mi->first, mi->second));
sort(vCommands.begin(), vCommands.end());
+ JSONRPCRequest jreq(helpreq);
+ jreq.fHelp = true;
+ jreq.params = UniValue();
+
BOOST_FOREACH(const PAIRTYPE(string, const CRPCCommand*)& command, vCommands)
{
const CRPCCommand *pcmd = command.second;
string strMethod = pcmd->name;
if ((strCommand != "" || pcmd->category == "hidden") && strMethod != strCommand)
continue;
+ jreq.strMethod = strMethod;
try
{
- JSONRPCRequest jreq;
- jreq.fHelp = true;
rpcfn_type pfn = pcmd->actor;
if (setDone.insert(pfn).second)
(*pfn)(jreq);
@@ -247,7 +250,7 @@ UniValue help(const JSONRPCRequest& jsonRequest)
if (jsonRequest.params.size() > 0)
strCommand = jsonRequest.params[0].get_str();
- return tableRPC.help(strCommand);
+ return tableRPC.help(strCommand, jsonRequest);
}