aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/util.h
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2021-01-29 18:15:48 -0500
committerRussell Yanofsky <russ@yanofsky.org>2021-01-29 18:15:48 -0500
commit9048c58e10841d9e1d709c0a325dd14684cec325 (patch)
treeaa399e99d405412a1205c6eec856d5a886b21dc7 /src/rpc/util.h
parent14f3d9b908ed9e78997bfaad3d8a06357a89d46e (diff)
downloadbitcoin-9048c58e10841d9e1d709c0a325dd14684cec325.tar.xz
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.
Diffstat (limited to 'src/rpc/util.h')
-rw-r--r--src/rpc/util.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rpc/util.h b/src/rpc/util.h
index aaca887900..90521949a6 100644
--- a/src/rpc/util.h
+++ b/src/rpc/util.h
@@ -337,8 +337,8 @@ public:
UniValue HandleRequest(const JSONRPCRequest& request);
std::string ToString() const;
- /** Append the named args that need to be converted from string to another JSON type */
- void AppendArgMap(UniValue& arr) const;
+ /** Return the named args that need to be converted from string to another JSON type */
+ UniValue GetArgMap() const;
/** If the supplied number of args is neither too small nor too high */
bool IsValidNumArgs(size_t num_args) const;
std::vector<std::string> GetArgNames() const;