diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2021-08-30 21:04:06 -0400 |
---|---|---|
committer | Russell Yanofsky <russ@yanofsky.org> | 2021-09-16 14:17:01 -0400 |
commit | ad085f9ba15c131fc5cc77086a620f2e366aac7c (patch) | |
tree | 15ae7e775054d670ba7def6754e04e934d974383 /src/init.cpp | |
parent | 6ef84e0503994c53f77093e7ea5951a7b0edea7a (diff) |
multiprocess: Delay wallet client construction
Delay wallet client construction until after logging, thread and other
init for two reasons:
- More responsive multiprocess GUI startup. When bitcoin-gui is started
this moves the call from bitcoin-gui to bitcoin-node that spawns
bitcoin-wallet off of the GUI event thread and onto the background GUI
init executor thread.
- Avoids feature_logging.py test failures with bitcoin-node by making
bitcoin-wallet logging start after bitcoin-node logging starts,
because the tests are not written to handle the bitcoin-wallet logging
init code running first.
This partially reverts commit b266b3e0bf29d0f3d5deaeec62d57c5025b35525,
moving wallet client creation back to the place it was located before.
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/init.cpp b/src/init.cpp index ff36ec805c..017c598ad5 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1065,11 +1065,6 @@ bool AppInitLockDataDirectory() bool AppInitInterfaces(NodeContext& node) { node.chain = node.init->makeChain(); - // Create client interfaces for wallets that are supposed to be loaded - // according to -wallet and -disablewallet options. This only constructs - // the interfaces, it doesn't load wallet data. Wallets actually get loaded - // when load() and start() interface methods are called below. - g_wallet_init_interface.Construct(node); return true; } @@ -1133,6 +1128,13 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) GetMainSignals().RegisterBackgroundSignalScheduler(*node.scheduler); + // Create client interfaces for wallets that are supposed to be loaded + // according to -wallet and -disablewallet options. This only constructs + // the interfaces, it doesn't load wallet data. Wallets actually get loaded + // when load() and start() interface methods are called below. + g_wallet_init_interface.Construct(node); + uiInterface.InitWallet(); + /* Register RPC commands regardless of -server setting so they will be * available in the GUI RPC console even if external calls are disabled. */ |