25 for (std::list<CZMQAbstractNotifier*>::iterator i=
notifiers.begin(); i!=
notifiers.end(); ++i)
34 std::map<std::string, CZMQNotifierFactory> factories;
35 std::list<CZMQAbstractNotifier*>
notifiers;
37 factories[
"pubhashblock"] = CZMQAbstractNotifier::Create<CZMQPublishHashBlockNotifier>;
38 factories[
"pubhashtx"] = CZMQAbstractNotifier::Create<CZMQPublishHashTransactionNotifier>;
39 factories[
"pubrawblock"] = CZMQAbstractNotifier::Create<CZMQPublishRawBlockNotifier>;
40 factories[
"pubrawtx"] = CZMQAbstractNotifier::Create<CZMQPublishRawTransactionNotifier>;
42 for (
const auto& entry : factories)
44 std::string arg(
"-zmq" + entry.first);
63 delete notificationInterface;
64 notificationInterface =
nullptr;
68 return notificationInterface;
81 zmqError(
"Unable to initialize context");
85 std::list<CZMQAbstractNotifier*>::iterator i=
notifiers.begin();
114 for (std::list<CZMQAbstractNotifier*>::iterator i=
notifiers.begin(); i!=
notifiers.end(); ++i)
128 if (fInitialDownload || pindexNew == pindexFork)
131 for (std::list<CZMQAbstractNotifier*>::iterator i =
notifiers.begin(); i!=
notifiers.end(); )
152 for (std::list<CZMQAbstractNotifier*>::iterator i =
notifiers.begin(); i!=
notifiers.end(); )
bool IsArgSet(const std::string &strArg) const
Return true if the given argument has been manually set.
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
The block chain is a tree shaped structure starting with the genesis block at the root,...
The basic transaction that is broadcasted on the network and contained in blocks.
std::string GetType() const
virtual void Shutdown()=0
void SetAddress(const std::string &a)
virtual bool NotifyBlock(const CBlockIndex *pindex)
virtual bool Initialize(void *pcontext)=0
virtual bool NotifyTransaction(const CTransaction &transaction)
std::string GetAddress() const
void SetType(const std::string &t)
virtual ~CZMQNotificationInterface()
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.
CZMQNotificationInterface()
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
#define LogPrint(category,...)
std::shared_ptr< const CTransaction > CTransactionRef
CZMQAbstractNotifier *(* CZMQNotifierFactory)()
void zmqError(const char *str)