BSHA3  0.17.99
P2P Blockchain, based on Bitcoin
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 #include <string>
10 #include <map>
11 #include <list>
12 
13 class CBlockIndex;
15 
17 {
18 public:
20 
21  std::list<const CZMQAbstractNotifier*> GetActiveNotifiers() const;
22 
24 
25 protected:
26  bool Initialize();
27  void Shutdown();
28 
29  // CValidationInterface
30  void TransactionAddedToMempool(const CTransactionRef& tx) override;
31  void BlockConnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindexConnected, const std::vector<CTransactionRef>& vtxConflicted) override;
32  void BlockDisconnected(const std::shared_ptr<const CBlock>& pblock) override;
33  void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override;
34 
35 private:
37 
38  void *pcontext;
39  std::list<CZMQAbstractNotifier*> notifiers;
40 };
41 
43 
44 #endif // BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H
void TransactionAddedToMempool(const CTransactionRef &tx) override
Notifies listeners of a transaction having been added to mempool.
void BlockConnected(const std::shared_ptr< const CBlock > &pblock, const CBlockIndex *pindexConnected, const std::vector< CTransactionRef > &vtxConflicted) override
Notifies listeners of a block being connected.
std::shared_ptr< const CTransaction > CTransactionRef
Definition: transaction.h:402
Implement this to subscribe to events generated in validation.
static CZMQNotificationInterface * Create()
void BlockDisconnected(const std::shared_ptr< const CBlock > &pblock) override
Notifies listeners of a block being disconnected.
void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override
Notifies listeners when the block chain tip advances.
std::list< CZMQAbstractNotifier * > notifiers
The block chain is a tree shaped structure starting with the genesis block at the root...
Definition: chain.h:170
CZMQNotificationInterface * g_zmq_notification_interface
std::list< const CZMQAbstractNotifier * > GetActiveNotifiers() const