mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-11 05:03:16 +01:00
refactor: Create interfaces earlier during initialization
Add AppInitInterfaces function so wallet chain and chain client interfaces are created earlier during initialization. This is needed in the next commit to allow the gui splash screen to be able to register for wallet events through a dedicated WalletClient interface instead managing wallets indirectly through the Node interface. This only works if the wallet client interface is created before the splash screen needs to use it.
This commit is contained in:
@@ -44,7 +44,6 @@ static void WaitForShutdown(NodeContext& node)
|
||||
static bool AppInit(int argc, char* argv[])
|
||||
{
|
||||
NodeContext node;
|
||||
node.chain = interfaces::MakeChain(node);
|
||||
|
||||
bool fRet = false;
|
||||
|
||||
@@ -144,7 +143,7 @@ static bool AppInit(int argc, char* argv[])
|
||||
// If locking the data directory failed, exit immediately
|
||||
return false;
|
||||
}
|
||||
fRet = AppInitMain(context, node);
|
||||
fRet = AppInitInterfaces(node) && AppInitMain(context, node);
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
PrintExceptionContinue(&e, "AppInit()");
|
||||
|
||||
Reference in New Issue
Block a user