mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-14 16:50:17 +02:00
wallet: Postpone NotifyWalletLoaded() for encrypted wallets
Too early NotifyWalletLoaded() call in CWallet::Create() results the notification goes before DescriptorScriptPubKeyMans were created and added to an encrypted wallet. Co-authored-by: Andrew Chow <achow101-github@achow101.com>
This commit is contained in:
@@ -240,6 +240,8 @@ std::shared_ptr<CWallet> LoadWalletInternal(WalletContext& context, const std::s
|
||||
status = DatabaseStatus::FAILED_LOAD;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
NotifyWalletLoaded(context, wallet);
|
||||
AddWallet(context, wallet);
|
||||
wallet->postInitProcess();
|
||||
|
||||
@@ -356,6 +358,8 @@ std::shared_ptr<CWallet> CreateWallet(WalletContext& context, const std::string&
|
||||
wallet->Lock();
|
||||
}
|
||||
}
|
||||
|
||||
NotifyWalletLoaded(context, wallet);
|
||||
AddWallet(context, wallet);
|
||||
wallet->postInitProcess();
|
||||
|
||||
@@ -2912,8 +2916,6 @@ std::shared_ptr<CWallet> CWallet::Create(WalletContext& context, const std::stri
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
NotifyWalletLoaded(context, walletInstance);
|
||||
|
||||
{
|
||||
LOCK(walletInstance->cs_wallet);
|
||||
walletInstance->SetBroadcastTransactions(args.GetBoolArg("-walletbroadcast", DEFAULT_WALLETBROADCAST));
|
||||
|
||||
Reference in New Issue
Block a user