mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Remove pointer cast in CRPCTable::dumpArgMap
CRPCTable::dumpArgMap currently works by casting RPC command unique_id integer field to a function pointer, and then calling the function. The unique_id field wasn't supposed to be used this way (it's meant to be used to detect RPC aliases), and this code segfaults in the rpc_help.py test in multiprocess PR https://github.com/bitcoin/bitcoin/pull/10102 because wallet RPC functions aren't directly accessible from the node process. Fix this by adding a new GET_ARGS request mode to retrieve argument information similar to the way the GET_HELP mode retrieves help information.
This commit is contained in:
@@ -34,7 +34,7 @@ public:
|
||||
UniValue id;
|
||||
std::string strMethod;
|
||||
UniValue params;
|
||||
enum Mode { EXECUTE, GET_HELP } mode = EXECUTE;
|
||||
enum Mode { EXECUTE, GET_HELP, GET_ARGS } mode = EXECUTE;
|
||||
std::string URI;
|
||||
std::string authUser;
|
||||
std::string peerAddr;
|
||||
|
||||
Reference in New Issue
Block a user