diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index a49df17e5aa585..f648fc2ceddc86 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -4998,6 +4998,7 @@ bool CWallet::AttachChain(const std::shared_ptr& walletInstance, interf // so that in case of a shutdown event, the rescan will be repeated at the next start. // This is temporary until rescan and notifications delivery are unified under same // interface. + walletInstance->m_attaching_chain = true; //ignores chainStateFlushed notifications walletInstance->m_chain_notifications_handler = walletInstance->chain().handleNotifications(walletInstance); int rescan_height = 0; @@ -5023,7 +5024,6 @@ bool CWallet::AttachChain(const std::shared_ptr& walletInstance, interf if (tip_height && *tip_height != rescan_height) { - walletInstance->m_attaching_chain = true; //ignores chainStateFlushed notifications if (chain.havePruned()) { int block_height = *tip_height; while (block_height > 0 && chain.haveBlockOnDisk(block_height - 1) && rescan_height != block_height) { @@ -5070,6 +5070,7 @@ bool CWallet::AttachChain(const std::shared_ptr& walletInstance, interf walletInstance->chainStateFlushed(chain.getTipLocator()); walletInstance->GetDatabase().IncrementUpdateCounter(); } + walletInstance->m_attaching_chain = false; return true; }