diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index c46ff608b9..dec55cb465 100755 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3199,6 +3199,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); // If rescan_required = true, rescan_height remains equal to 0 @@ -3225,7 +3226,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) { @@ -3269,6 +3269,7 @@ bool CWallet::AttachChain(const std::shared_ptr& walletInstance, interf walletInstance->chainStateFlushed(chain.getTipLocator()); walletInstance->GetDatabase().IncrementUpdateCounter(); } + walletInstance->m_attaching_chain = false; return true; }