Page MenuHomePhabricator

Remove pointer cast in CRPCTable::dumpArgMap
ClosedPublic

Authored by PiRK on Jan 5 2022, 12:09.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC64ea6e739c7f: 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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable