aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/chain.h
diff options
context:
space:
mode:
authorAntoine Riard <ariard@student.42.fr>2019-04-18 08:21:35 -0400
committerAntoine Riard <ariard@student.42.fr>2019-04-23 13:53:46 -0400
commit422677963a7b41e340b911b4cd53d29dd8d63f21 (patch)
tree90de47147f475d9b879fd7d65bb2015dad032d0b /src/interfaces/chain.h
parentedfe9438ca54274815f076fc21beb790df5aa0a2 (diff)
refactor: replace isPotentialtip/waitForNotifications by higher method
Add GUARDED_BY(cs_wallet) annotation to m_last_block_processed, given that its now guarded by cs_wallet instead of cs_main
Diffstat (limited to 'src/interfaces/chain.h')
-rw-r--r--src/interfaces/chain.h17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/interfaces/chain.h b/src/interfaces/chain.h
index 17d7b6d8f1..9f975cb92f 100644
--- a/src/interfaces/chain.h
+++ b/src/interfaces/chain.h
@@ -43,12 +43,6 @@ class Wallet;
//! asynchronously
//! (https://github.com/bitcoin/bitcoin/pull/10973#issuecomment-380101269).
//!
-//! * The isPotentialTip() and waitForNotifications() methods are too low-level
-//! and should be replaced with a higher level
-//! waitForNotificationsUpTo(block_hash) method that the wallet can call
-//! instead
-//! (https://github.com/bitcoin/bitcoin/pull/10973#discussion_r266995234).
-//!
//! * The relayTransactions() and submitToMemoryPool() methods could be replaced
//! with a higher-level broadcastTransaction method
//! (https://github.com/bitcoin/bitcoin/pull/14978#issuecomment-459373984).
@@ -132,11 +126,6 @@ public:
//! information is desired).
virtual Optional<int> findFork(const uint256& hash, Optional<int>* height) = 0;
- //! Return true if block hash points to the current chain tip, or to a
- //! possible descendant of the current chain tip that isn't currently
- //! connected.
- virtual bool isPotentialTip(const uint256& hash) = 0;
-
//! Get locator for the current chain tip.
virtual CBlockLocator getTipLocator() = 0;
@@ -271,8 +260,10 @@ public:
//! Register handler for notifications.
virtual std::unique_ptr<Handler> handleNotifications(Notifications& notifications) = 0;
- //! Wait for pending notifications to be handled.
- virtual void waitForNotifications() = 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 uint256& old_tip) = 0;
//! Register handler for RPC. Command is not copied, so reference
//! needs to remain valid until Handler is disconnected.