mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
rpc: Avoid initialization-order-fiasco on static CRPCCommand tables
This commit is contained in:
@@ -760,6 +760,8 @@ static UniValue getnodeaddresses(const JSONRPCRequest& request)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void RegisterNetRPCCommands(CRPCTable &t)
|
||||
{
|
||||
// clang-format off
|
||||
static const CRPCCommand commands[] =
|
||||
{ // category name actor (function) argNames
|
||||
@@ -780,8 +782,6 @@ static const CRPCCommand commands[] =
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
void RegisterNetRPCCommands(CRPCTable &t)
|
||||
{
|
||||
for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++)
|
||||
t.appendCommand(commands[vcidx].name, &commands[vcidx]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user