PIVX Core  5.6.99
P2P Digital Currency
zmqnotificationinterface.h
Go to the documentation of this file.
1 // Copyright (c) 2015 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 PIVX_ZMQ_ZMQNOTIFICATIONINTERFACE_H
6 #define PIVX_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 
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, const CBlockIndex* pindexConnected) override;
30  void BlockDisconnected(const std::shared_ptr<const CBlock>& pblock, const uint256& blockHash, int nBlockHeight, int64_t blockTime) override;
31  void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override;
32 
33 private:
35 
36  void *pcontext;
37  std::list<CZMQAbstractNotifier*> notifiers;
38 };
39 
40 #endif // PIVX_ZMQ_ZMQNOTIFICATIONINTERFACE_H
The block chain is a tree shaped structure starting with the genesis block at the root,...
Definition: chain.h:139
Implement this to subscribe to events generated in validation.
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.
void TransactionAddedToMempool(const CTransactionRef &tx) override
Notifies listeners of a transaction having been added to mempool.
void BlockDisconnected(const std::shared_ptr< const CBlock > &pblock, const uint256 &blockHash, int nBlockHeight, int64_t blockTime) override
Notifies listeners of a block being disconnected.
std::list< CZMQAbstractNotifier * > notifiers
256-bit opaque blob.
Definition: uint256.h:138
std::shared_ptr< const CTransaction > CTransactionRef
Definition: transaction.h:456