Bitcoin ABC  0.26.3
P2P Digital Currency
zmqnotificationinterface.h
Go to the documentation of this file.
1 // Copyright (c) 2015-2018 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H
6 #define BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H
7 
8 #include <validationinterface.h>
9 
10 #include <list>
11 #include <memory>
12 
13 class CBlockIndex;
15 
17 public:
19 
20  std::list<const CZMQAbstractNotifier *> GetActiveNotifiers() const;
21 
23 
24 protected:
25  bool Initialize();
26  void Shutdown();
27 
28  // CValidationInterface
30  std::shared_ptr<const std::vector<Coin>>,
31  uint64_t mempool_sequence) override;
33  MemPoolRemovalReason reason,
34  uint64_t mempool_sequence) override;
35  void BlockConnected(const std::shared_ptr<const CBlock> &pblock,
36  const CBlockIndex *pindexConnected) override;
37  void BlockDisconnected(const std::shared_ptr<const CBlock> &pblock,
38  const CBlockIndex *pindexDisconnected) override;
39  void UpdatedBlockTip(const CBlockIndex *pindexNew,
40  const CBlockIndex *pindexFork,
41  bool fInitialDownload) override;
42 
43 private:
45 
46  void *pcontext;
47  std::list<std::unique_ptr<CZMQAbstractNotifier>> notifiers;
48 };
49 
51 
52 #endif // BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H
The block chain is a tree shaped structure starting with the genesis block at the root,...
Definition: blockindex.h:26
Implement this to subscribe to events generated in validation.
void TransactionAddedToMempool(const CTransactionRef &tx, std::shared_ptr< const std::vector< Coin >>, uint64_t mempool_sequence) override
Notifies listeners of a transaction having been added to mempool.
void BlockConnected(const std::shared_ptr< const CBlock > &pblock, const CBlockIndex *pindexConnected) override
Notifies listeners of a block being connected.
static CZMQNotificationInterface * Create()
void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override
Notifies listeners when the block chain tip advances.
std::list< std::unique_ptr< CZMQAbstractNotifier > > notifiers
void BlockDisconnected(const std::shared_ptr< const CBlock > &pblock, const CBlockIndex *pindexDisconnected) override
Notifies listeners of a block being disconnected.
void TransactionRemovedFromMempool(const CTransactionRef &tx, MemPoolRemovalReason reason, uint64_t mempool_sequence) override
Notifies listeners of a transaction leaving mempool.
std::list< const CZMQAbstractNotifier * > GetActiveNotifiers() const
std::shared_ptr< const CTransaction > CTransactionRef
Definition: transaction.h:315
MemPoolRemovalReason
Reason why a transaction was removed from the mempool, this is passed to the notification signal.
Definition: txmempool.h:148
CZMQNotificationInterface * g_zmq_notification_interface