mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01: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:
@@ -2509,7 +2509,7 @@ extern UniValue importwallet(const UniValue& params, bool fHelp);
|
||||
extern UniValue importprunedfunds(const UniValue& params, bool fHelp);
|
||||
extern UniValue removeprunedfunds(const UniValue& params, bool fHelp);
|
||||
|
||||
const CRPCCommand vWalletRPCCommands[] =
|
||||
static const CRPCCommand commands[] =
|
||||
{ // category name actor (function) okSafeMode
|
||||
// --------------------- ------------------------ ----------------------- ----------
|
||||
{ "rawtransactions", "fundrawtransaction", &fundrawtransaction, false },
|
||||
@@ -2559,14 +2559,8 @@ const CRPCCommand vWalletRPCCommands[] =
|
||||
{ "wallet", "removeprunedfunds", &removeprunedfunds, true },
|
||||
};
|
||||
|
||||
void walletRegisterRPCCommands()
|
||||
void RegisterWalletRPCCommands(CRPCTable &tableRPC)
|
||||
{
|
||||
unsigned int vcidx;
|
||||
for (vcidx = 0; vcidx < ARRAYLEN(vWalletRPCCommands); vcidx++)
|
||||
{
|
||||
const CRPCCommand *pcmd;
|
||||
|
||||
pcmd = &vWalletRPCCommands[vcidx];
|
||||
tableRPC.appendCommand(pcmd->name, pcmd);
|
||||
}
|
||||
for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++)
|
||||
tableRPC.appendCommand(commands[vcidx].name, &commands[vcidx]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user