From 9048c58e10841d9e1d709c0a325dd14684cec325 Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Fri, 29 Jan 2021 18:15:48 -0500 Subject: 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. --- src/rpc/server.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/rpc/server.h') diff --git a/src/rpc/server.h b/src/rpc/server.h index fe5a791e1e..03967020c2 100644 --- a/src/rpc/server.h +++ b/src/rpc/server.h @@ -148,7 +148,7 @@ public: /** * Return all named arguments that need to be converted by the client from string to another JSON type */ - UniValue dumpArgMap() const; + UniValue dumpArgMap(const JSONRPCRequest& request) const; /** * Appends a CRPCCommand to the dispatch table. -- cgit v1.2.3