@@ -188,7 +188,7 @@ bool ParseBool(const UniValue& o, std::string strKey)
188
188
* Note: This interface may still be subject to change.
189
189
*/
190
190
191
- std::string CRPCTable::help (std::string strCommand) const
191
+ std::string CRPCTable::help (const std::string& strCommand, const JSONRPCRequest& helpreq ) const
192
192
{
193
193
std::string strRet;
194
194
std::string category;
@@ -199,14 +199,17 @@ std::string CRPCTable::help(std::string strCommand) const
199
199
vCommands.emplace_back (entry.second ->category + entry.first , entry.second );
200
200
std::sort (vCommands.begin (), vCommands.end ());
201
201
202
+ JSONRPCRequest jreq (helpreq);
203
+ jreq.fHelp = true ;
204
+ jreq.params = UniValue ();
205
+
202
206
for (const std::pair<std::string, const CRPCCommand*>& command : vCommands) {
203
207
const CRPCCommand* pcmd = command.second ;
204
208
std::string strMethod = pcmd->name ;
205
209
if ((strCommand != " " || pcmd->category == " hidden" ) && strMethod != strCommand)
206
210
continue ;
211
+ jreq.strMethod = strMethod;
207
212
try {
208
- JSONRPCRequest jreq;
209
- jreq.fHelp = true ;
210
213
rpcfn_type pfn = pcmd->actor ;
211
214
if (setDone.insert (pfn).second )
212
215
(*pfn)(jreq);
@@ -248,7 +251,7 @@ UniValue help(const JSONRPCRequest& jsonRequest)
248
251
if (jsonRequest.params .size () > 0 )
249
252
strCommand = jsonRequest.params [0 ].get_str ();
250
253
251
- return tableRPC.help (strCommand);
254
+ return tableRPC.help (strCommand, jsonRequest );
252
255
}
253
256
254
257
0 commit comments