2018-01-03 02:12:05 +09:00
|
|
|
// Copyright (c) 2015-2017 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
|
|
|
|
|
2017-11-10 13:57:53 +13:00
|
|
|
#include <validationinterface.h>
|
2014-11-18 12:06:32 -05:00
|
|
|
#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;
|
|
|
|
|
2017-07-12 16:48:36 -04:00
|
|
|
class CZMQNotificationInterface final : public CValidationInterface
|
2014-11-18 12:06:32 -05:00
|
|
|
{
|
|
|
|
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-02-08 14:00:14 -05:00
|
|
|
void TransactionAddedToMempool(const CTransactionRef& tx) override;
|
|
|
|
void BlockConnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindexConnected, const std::vector<CTransactionRef>& vtxConflicted) override;
|
|
|
|
void BlockDisconnected(const std::shared_ptr<const CBlock>& pblock) override;
|
|
|
|
void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override;
|
2014-11-18 12:06:32 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
CZMQNotificationInterface();
|
|
|
|
|
|
|
|
void *pcontext;
|
|
|
|
std::list<CZMQAbstractNotifier*> notifiers;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H
|