diff --git a/src/wallet/load.cpp b/src/wallet/load.cpp index 98ce95dcd1c..c06513588b5 100644 --- a/src/wallet/load.cpp +++ b/src/wallet/load.cpp @@ -130,6 +130,8 @@ bool LoadWallets(WalletContext& context) chain.initError(error); return false; } + + NotifyWalletLoaded(context, pwallet); AddWallet(context, pwallet); } return true; diff --git a/src/wallet/test/wallet_tests.cpp b/src/wallet/test/wallet_tests.cpp index 5518f4fdaed..683f0eb3272 100644 --- a/src/wallet/test/wallet_tests.cpp +++ b/src/wallet/test/wallet_tests.cpp @@ -54,6 +54,7 @@ static const std::shared_ptr TestLoadWallet(WalletContext& context) std::vector 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(); } diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 99113a1a719..2a0653c719b 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -240,6 +240,8 @@ std::shared_ptr 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 CreateWallet(WalletContext& context, const std::string& wallet->Lock(); } } + + NotifyWalletLoaded(context, wallet); AddWallet(context, wallet); wallet->postInitProcess(); @@ -2912,8 +2916,6 @@ std::shared_ptr CWallet::Create(WalletContext& context, const std::stri return nullptr; } - NotifyWalletLoaded(context, walletInstance); - { LOCK(walletInstance->cs_wallet); walletInstance->SetBroadcastTransactions(args.GetBoolArg("-walletbroadcast", DEFAULT_WALLETBROADCAST));