Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13115683
D7511.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D7511.diff
View Options
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> 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<NotificationsHandlerImpl>(
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 {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 1, 11:43 (3 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5187679
Default Alt Text
D7511.diff (2 KB)
Attached To
D7511: [backport#15931 6/9] Only return early from BlockUntilSyncedToCurrentChain if current tip is exact match
Event Timeline
Log In to Comment