Merge #11726: Cleanups + nit fixes for walletdir PR
[bitcoinplatinum.git] / src / zmq / zmqnotificationinterface.h
blob222d31e2adfcbd789937b9c317c2950b86117d9e
1 // Copyright (c) 2015-2016 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.
5 #ifndef BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H
6 #define BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H
8 #include <validationinterface.h>
9 #include <string>
10 #include <map>
11 #include <list>
13 class CBlockIndex;
14 class CZMQAbstractNotifier;
16 class CZMQNotificationInterface final : public CValidationInterface
18 public:
19 virtual ~CZMQNotificationInterface();
21 static CZMQNotificationInterface* Create();
23 protected:
24 bool Initialize();
25 void Shutdown();
27 // CValidationInterface
28 void TransactionAddedToMempool(const CTransactionRef& tx) override;
29 void BlockConnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindexConnected, const std::vector<CTransactionRef>& vtxConflicted) override;
30 void BlockDisconnected(const std::shared_ptr<const CBlock>& pblock) override;
31 void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override;
33 private:
34 CZMQNotificationInterface();
36 void *pcontext;
37 std::list<CZMQAbstractNotifier*> notifiers;
40 #endif // BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H