mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-01 00:10:44 +01: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:
@@ -4256,6 +4256,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
|
||||
@@ -4319,8 +4321,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