aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/chain.h
diff options
context:
space:
mode:
authorJoão Barbosa <[email protected]>2019-03-27 17:00:06 +0000
committerMarcoFalke <[email protected]>2019-04-01 16:34:37 -0400
commited0498af2827ccf033c9a7c4f46b82424e411083 (patch)
tree27d07231195940aeb8c94760face92f29e5c8c84 /src/interfaces/chain.h
parentwallet: Move CWallet::ReacceptWalletTransactions locks to callers (diff)
downloaddiscoin-ed0498af2827ccf033c9a7c4f46b82424e411083.tar.xz
discoin-ed0498af2827ccf033c9a7c4f46b82424e411083.zip
interfaces: Add Chain::requestMempoolTransactions
Github-Pull: #15652 Rebased-From: 57908a739ca377d60ef224ce0f565d4412a414f4
Diffstat (limited to 'src/interfaces/chain.h')
-rw-r--r--src/interfaces/chain.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/interfaces/chain.h b/src/interfaces/chain.h
index 3a54b9164..57e970375 100644
--- a/src/interfaces/chain.h
+++ b/src/interfaces/chain.h
@@ -16,6 +16,9 @@ class CBlock;
class CScheduler;
class uint256;
struct CBlockLocator;
+class CTransaction;
+
+using CTransactionRef = std::shared_ptr<const CTransaction>;
namespace interfaces {
@@ -127,6 +130,16 @@ public:
//! Estimate fraction of total transactions verified if blocks up to
//! the specified block hash are verified.
virtual double guessVerificationProgress(const uint256& block_hash) = 0;
+
+ //! Synchronously send TransactionAddedToMempool notifications about all
+ //! current mempool transactions to the specified handler and return after
+ //! the last one is sent. These notifications aren't coordinated with async
+ //! notifications sent by handleNotifications, so out of date async
+ //! notifications from handleNotifications can arrive during and after
+ //! synchronous notifications from requestMempoolTransactions. Clients need
+ //! to be prepared to handle this by ignoring notifications about unknown
+ //! removed transactions and already added new transactions.
+ virtual void requestMempoolTransactions(std::function<void(const CTransactionRef&)> fn) = 0;
};
//! Interface to let node manage chain clients (wallets, or maybe tools for