mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-03 20:35:17 +02:00
Merge #18532: rpc: Avoid initialization-order-fiasco on static CRPCCommand tables
fa1a92224drpc: Avoid initialization-order-fiasco on static CRPCCommand tables (MarcoFalke) Pull request description: Currently the fiasco is only theoretical because all content of the table are compile-time constants. However, the fiasco materializes should they ever become run-time constants (e.g. #18531). ACKs for top commit: promag: ACKfa1a92224d. practicalswift: ACKfa1a92224d-- fiasco bad :) Tree-SHA512: cccadb0ad56194599b74f04264d74c34fa865958580a850efc6474bbdc56f30cadce6b2e9a6ad5472ff46c3f4c793366acd8090fad409a45b25d961f2d89da19
This commit is contained in:
@@ -2347,6 +2347,8 @@ UniValue dumptxoutset(const JSONRPCRequest& request)
|
||||
return result;
|
||||
}
|
||||
|
||||
void RegisterBlockchainRPCCommands(CRPCTable &t)
|
||||
{
|
||||
// clang-format off
|
||||
static const CRPCCommand commands[] =
|
||||
{ // category name actor (function) argNames
|
||||
@@ -2387,8 +2389,6 @@ static const CRPCCommand commands[] =
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
void RegisterBlockchainRPCCommands(CRPCTable &t)
|
||||
{
|
||||
for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++)
|
||||
t.appendCommand(commands[vcidx].name, &commands[vcidx]);
|
||||
}
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
|
||||
@@ -589,6 +589,8 @@ static UniValue echo(const JSONRPCRequest& request)
|
||||
return request.params;
|
||||
}
|
||||
|
||||
void RegisterMiscRPCCommands(CRPCTable &t)
|
||||
{
|
||||
// clang-format off
|
||||
static const CRPCCommand commands[] =
|
||||
{ // category name actor (function) argNames
|
||||
@@ -610,8 +612,6 @@ static const CRPCCommand commands[] =
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
void RegisterMiscRPCCommands(CRPCTable &t)
|
||||
{
|
||||
for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++)
|
||||
t.appendCommand(commands[vcidx].name, &commands[vcidx]);
|
||||
}
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
|
||||
@@ -1813,6 +1813,8 @@ UniValue analyzepsbt(const JSONRPCRequest& request)
|
||||
return result;
|
||||
}
|
||||
|
||||
void RegisterRawTransactionRPCCommands(CRPCTable &t)
|
||||
{
|
||||
// clang-format off
|
||||
static const CRPCCommand commands[] =
|
||||
{ // category name actor (function) argNames
|
||||
@@ -1839,8 +1841,6 @@ static const CRPCCommand commands[] =
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
void RegisterRawTransactionRPCCommands(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