2016-12-31 11:01:21 -07:00
|
|
|
// Copyright (c) 2015-2016 The Bitcoin Core developers
|
2014-11-18 12:06:32 -05:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
#ifndef BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H
|
|
|
|
#define BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H
|
|
|
|
|
|
|
|
#include "validationinterface.h"
|
|
|
|
#include <string>
|
|
|
|
#include <map>
|
2017-01-20 18:27:13 -05:00
|
|
|
#include <list>
|
2014-11-18 12:06:32 -05:00
|
|
|
|
2015-09-16 16:42:23 +02:00
|
|
|
class CBlockIndex;
|
2014-11-18 12:06:32 -05:00
|
|
|
class CZMQAbstractNotifier;
|
|
|
|
|
|
|
|
class CZMQNotificationInterface : public CValidationInterface
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~CZMQNotificationInterface();
|
|
|
|
|
2016-11-29 18:43:29 -08:00
|
|
|
static CZMQNotificationInterface* Create();
|
2014-11-18 12:06:32 -05:00
|
|
|
|
2015-11-01 18:09:17 +00:00
|
|
|
protected:
|
2014-11-18 12:06:32 -05:00
|
|
|
bool Initialize();
|
|
|
|
void Shutdown();
|
|
|
|
|
2015-11-01 18:09:17 +00:00
|
|
|
// CValidationInterface
|
2017-03-29 21:12:42 -04:00
|
|
|
void TransactionAddedToMempool(const CTransactionRef& tx);
|
|
|
|
void BlockConnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindexConnected, const std::vector<CTransactionRef>& vtxConflicted);
|
|
|
|
void BlockDisconnected(const std::shared_ptr<const CBlock>& pblock);
|
2016-09-30 17:40:03 -04:00
|
|
|
void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload);
|
2014-11-18 12:06:32 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
CZMQNotificationInterface();
|
|
|
|
|
|
|
|
void *pcontext;
|
|
|
|
std::list<CZMQAbstractNotifier*> notifiers;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H
|