aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2022-03-29 22:28:42 +0200
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2022-03-30 21:28:53 +0200
commit0c12f0116ca802f55f5ab43e6c4842ac403b9889 (patch)
tree8bb0fdfe00848316a364ea89749d8f8d0eba94d9 /src/wallet/wallet.cpp
parentaeee419c6aae085cacd75343c1ce23486b2b8916 (diff)
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>
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 99113a1a71..2a0653c719 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -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));