diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-04-07 23:45:34 +0800 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-04-07 23:46:17 +0800 |
commit | 1b151e3ffce7c1a2ee46bf280cc1d96775d1f91e (patch) | |
tree | 1e7c463bf86abbc4f14c549666e30eef0d6b9732 /src/wallet/rpcwallet.cpp | |
parent | 63dad673487d3623f9076721d2a1924263272eb9 (diff) | |
parent | fa1a92224dd78de817d15bcda35a8310254e1a54 (diff) | |
download | bitcoin-1b151e3ffce7c1a2ee46bf280cc1d96775d1f91e.tar.xz |
Merge #18532: rpc: Avoid initialization-order-fiasco on static CRPCCommand tables
fa1a92224dd78de817d15bcda35a8310254e1a54 rpc: 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:
ACK fa1a92224dd78de817d15bcda35a8310254e1a54.
practicalswift:
ACK fa1a92224dd78de817d15bcda35a8310254e1a54 -- fiasco bad :)
Tree-SHA512: cccadb0ad56194599b74f04264d74c34fa865958580a850efc6474bbdc56f30cadce6b2e9a6ad5472ff46c3f4c793366acd8090fad409a45b25d961f2d89da19
Diffstat (limited to 'src/wallet/rpcwallet.cpp')
-rw-r--r-- | src/wallet/rpcwallet.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 769a343365..61ad2f1198 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -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])); } |