diff --git a/src/interfaces/chain.h b/src/interfaces/chain.h --- a/src/interfaces/chain.h +++ b/src/interfaces/chain.h @@ -247,10 +247,8 @@ handleNotifications(std::shared_ptr notifications) = 0; //! Wait for pending notifications to be processed unless block hash points - //! to the current chain tip, or to a possible descendant of the current - //! chain tip that isn't currently connected. - virtual void - waitForNotificationsIfNewBlocksConnected(const BlockHash &old_tip) = 0; + //! to the current chain tip. + virtual void waitForNotificationsIfTipChanged(const BlockHash &old_tip) = 0; //! Register handler for RPC. Command is not copied, so reference //! needs to remain valid until Handler is disconnected. diff --git a/src/interfaces/chain.cpp b/src/interfaces/chain.cpp --- a/src/interfaces/chain.cpp +++ b/src/interfaces/chain.cpp @@ -383,18 +383,13 @@ return std::make_unique( std::move(notifications)); } - void waitForNotificationsIfNewBlocksConnected( - const BlockHash &old_tip) override { + void + waitForNotificationsIfTipChanged(const BlockHash &old_tip) override { if (!old_tip.IsNull()) { LOCK(::cs_main); if (old_tip == ::ChainActive().Tip()->GetBlockHash()) { return; } - CBlockIndex *block = LookupBlockIndex(old_tip); - if (block && block->GetAncestor(::ChainActive().Height()) == - ::ChainActive().Tip()) { - return; - } } SyncWithValidationInterfaceQueue(); } diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1199,7 +1199,7 @@ // are caught up at least with the time we entered this function). const BlockHash last_block_hash = WITH_LOCK(cs_wallet, return m_last_block_processed); - chain().waitForNotificationsIfNewBlocksConnected(last_block_hash); + chain().waitForNotificationsIfTipChanged(last_block_hash); } isminetype CWallet::IsMine(const CTxIn &txin) const {