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:
Hennadii Stepanov
2022-03-29 22:28:42 +02:00
parent aeee419c6a
commit 0c12f0116c
3 changed files with 7 additions and 2 deletions

View File

@@ -54,6 +54,7 @@ static const std::shared_ptr<CWallet> TestLoadWallet(WalletContext& context)
std::vector<bilingual_str> warnings;
auto database = MakeWalletDatabase("", options, status, error);
auto wallet = CWallet::Create(context, "", std::move(database), options.create_flags, error, warnings);
NotifyWalletLoaded(context, wallet);
if (context.chain) {
wallet->postInitProcess();
}