mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-30 07:47:36 +01:00
rpc: Avoid initialization-order-fiasco on static CRPCCommand tables
This commit is contained in:
@@ -4242,6 +4242,8 @@ UniValue importprunedfunds(const JSONRPCRequest& request);
|
||||
UniValue removeprunedfunds(const JSONRPCRequest& request);
|
||||
UniValue importmulti(const JSONRPCRequest& request);
|
||||
|
||||
void RegisterWalletRPCCommands(interfaces::Chain& chain, std::vector<std::unique_ptr<interfaces::Handler>>& handlers)
|
||||
{
|
||||
// clang-format off
|
||||
static const CRPCCommand commands[] =
|
||||
{ // category name actor (function) argNames
|
||||
@@ -4305,8 +4307,6 @@ static const CRPCCommand commands[] =
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
void RegisterWalletRPCCommands(interfaces::Chain& chain, std::vector<std::unique_ptr<interfaces::Handler>>& handlers)
|
||||
{
|
||||
for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++)
|
||||
handlers.emplace_back(chain.handleRpc(commands[vcidx]));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user