mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 15:39:05 +01:00
Merge #8775: RPC refactoring: Access wallet using new GetWalletForJSONRPCRequest
d678771Wallet: Sanitise -wallet parameter (Luke Dashjr)9756be3Wallet/RPC: Use filename rather than CWallet pointer, for lockwallet RPCRunLater job name (Luke Dashjr)86be48aMore tightly couple EnsureWalletIsAvailable with GetWalletForJSONRPCRequest where appropriate (Luke Dashjr)a435632Move wallet RPC declarations to rpcwallet.h (Luke Dashjr)ad15734RPC: Pass on JSONRPCRequest metadata (URI/user/etc) for "help" method (Luke Dashjr)bf8a04aReformat touched lines with C++11 (Luke Dashjr)2e518e3Move nWalletUnlockTime to CWallet::nRelockTime, and name timed task unique per CWallet (Luke Dashjr)d77ad6dRPC: Do all wallet access through new GetWalletForJSONRPCRequest (Luke Dashjr)eca550fRPC/Wallet: Pass CWallet as pointer to helper functions (Luke Dashjr) Tree-SHA512: bfd592da841693390e16f83b451503eb5cedb71208089aa32b3fc45e973555584a3ed7696dd239f6409324464d565dacf0f3d0e36e8e13ae6a7843848465f960
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user