rpc: Avoid initialization-order-fiasco on static CRPCCommand tables

This commit is contained in:
MarcoFalke
2020-04-06 00:21:33 +08:00
parent 4830077494
commit fa1a92224d
6 changed files with 12 additions and 12 deletions

View File

@@ -1022,6 +1022,8 @@ static UniValue estimaterawfee(const JSONRPCRequest& request)
return result;
}
void RegisterMiningRPCCommands(CRPCTable &t)
{
// clang-format off
static const CRPCCommand commands[] =
{ // category name actor (function) argNames
@@ -1043,8 +1045,6 @@ static const CRPCCommand commands[] =
};
// clang-format on
void RegisterMiningRPCCommands(CRPCTable &t)
{
for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++)
t.appendCommand(commands[vcidx].name, &commands[vcidx]);
}