HomePhabricator

Remove pointer cast in CRPCTable::dumpArgMap

Description

Remove pointer cast in CRPCTable::dumpArgMap

Summary:
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 core#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 is a backport of core#21035 [3/3]
https://github.com/bitcoin/bitcoin/pull/21035/commits/9048c58e10841d9e1d709c0a325dd14684cec325

Depends on D10765

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D10766

Details

Provenance
Russell Yanofsky <russ@yanofsky.org>Authored on Jan 29 2021, 23:15
PiRKCommitted on Jan 5 2022, 14:11
PiRKPushed on Jan 5 2022, 14:11
Reviewer
Restricted Project
Differential Revision
D10766: Remove pointer cast in CRPCTable::dumpArgMap
Parents
rABC8e70b7afa5c4: refactor: Add RPC server ExecuteCommands function
Branches
Unknown
Tags
Unknown