Bitcoin ABC  0.22.12
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 
12 class CBlockIndex;
14 
16 public:
18 
19  std::list<const CZMQAbstractNotifier *> GetActiveNotifiers() const;
20 
22 
23 protected:
24  bool Initialize();
25  void Shutdown();
26 
27  // CValidationInterface
28  void TransactionAddedToMempool(const CTransactionRef &tx) override;
29  void BlockConnected(const std::shared_ptr<const CBlock> &pblock,
30  const CBlockIndex *pindexConnected) override;
31  void BlockDisconnected(const std::shared_ptr<const CBlock> &pblock,
32  const CBlockIndex *pindexDisconnected) override;
33  void UpdatedBlockTip(const CBlockIndex *pindexNew,
34  const CBlockIndex *pindexFork,
35  bool fInitialDownload) override;
36 
37 private:
39 
40  void *pcontext;
41  std::list<CZMQAbstractNotifier *> notifiers;
42 };
43 
45 
46 #endif // BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H
std::shared_ptr< const CTransaction > CTransactionRef
Definition: transaction.h:338
void BlockDisconnected(const std::shared_ptr< const CBlock > &pblock, const CBlockIndex *pindexDisconnected) override
Notifies listeners of a block being disconnected.
std::list< CZMQAbstractNotifier * > notifiers
void TransactionAddedToMempool(const CTransactionRef &tx) override
Notifies listeners of a transaction having been added to mempool.
Implement this to subscribe to events generated in validation.
static CZMQNotificationInterface * Create()
void BlockConnected(const std::shared_ptr< const CBlock > &pblock, const CBlockIndex *pindexConnected) override
Notifies listeners of a block being connected.
void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override
Notifies listeners when the block chain tip advances.
The block chain is a tree shaped structure starting with the genesis block at the root...
Definition: blockindex.h:23
CZMQNotificationInterface * g_zmq_notification_interface
std::list< const CZMQAbstractNotifier * > GetActiveNotifiers() const