mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
rpc: Register calls where they are defined
Split out methods to every module, apart from 'help' and 'stop' which
are implemented in rpcserver.cpp itself.
- This makes it easier to add or remove RPC commands - no longer everything that includes
rpcserver.h has to be rebuilt when there's a change there.
- Cleans up `rpc/server.h` by getting rid of the huge cluttered list of function definitions.
- Removes most of the bitcoin-specific code from rpcserver.cpp and .h.
Continues #7307 for the non-wallet.
This commit is contained in:
parent
5131005e5b
commit
fb8a8cf2e6
15 changed files with 165 additions and 137 deletions
|
|
@ -36,7 +36,7 @@ UniValue CallRPC(string args)
|
|||
string strMethod = vArgs[0];
|
||||
vArgs.erase(vArgs.begin());
|
||||
UniValue params = RPCConvertValues(strMethod, vArgs);
|
||||
|
||||
BOOST_CHECK(tableRPC[strMethod]);
|
||||
rpcfn_type method = tableRPC[strMethod]->actor;
|
||||
try {
|
||||
UniValue result = (*method)(params, false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue