Add ZeroMQ support. Notify blocks and transactions via ZeroMQ
[bitcoinplatinum.git] / src / zmq / zmqnotificationinterface.h
blobafc0b8d24e51466174e14a91eeca853f961108c4
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.
5 #ifndef BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H
6 #define BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H
8 #include "validationinterface.h"
9 #include <string>
10 #include <map>
12 class CZMQAbstractNotifier;
14 class CZMQNotificationInterface : public CValidationInterface
16 public:
17 virtual ~CZMQNotificationInterface();
19 static CZMQNotificationInterface* CreateWithArguments(const std::map<std::string, std::string> &args);
21 bool Initialize();
22 void Shutdown();
24 protected: // CValidationInterface
25 void SyncTransaction(const CTransaction &tx, const CBlock *pblock);
26 void UpdatedBlockTip(const uint256 &newHashTip);
28 private:
29 CZMQNotificationInterface();
31 void *pcontext;
32 std::list<CZMQAbstractNotifier*> notifiers;
35 #endif // BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H