10 #include "validation.h" 27 for (std::list<CZMQAbstractNotifier*>::iterator i=
notifiers.begin(); i!=
notifiers.end(); ++i)
36 std::map<std::string, CZMQNotifierFactory> factories;
37 std::list<CZMQAbstractNotifier*>
notifiers;
39 factories[
"pubhashblock"] = CZMQAbstractNotifier::Create<CZMQPublishHashBlockNotifier>;
40 factories[
"pubhashtx"] = CZMQAbstractNotifier::Create<CZMQPublishHashTransactionNotifier>;
41 factories[
"pubrawblock"] = CZMQAbstractNotifier::Create<CZMQPublishRawBlockNotifier>;
42 factories[
"pubrawtx"] = CZMQAbstractNotifier::Create<CZMQPublishRawTransactionNotifier>;
43 factories[
"pubrawmessage"] = CZMQAbstractNotifier::Create<CZMQPublishNewAssetMessageNotifier>;
45 for (std::map<std::string, CZMQNotifierFactory>::const_iterator i=factories.begin(); i!=factories.end(); ++i)
47 std::string arg(
"-zmq" + i->first);
55 notifiers.push_back(notifier);
59 if (!notifiers.empty())
66 delete notificationInterface;
67 notificationInterface =
nullptr;
71 return notificationInterface;
84 zmqError(
"Unable to initialize context");
88 std::list<CZMQAbstractNotifier*>::iterator i=
notifiers.begin();
117 for (std::list<CZMQAbstractNotifier*>::iterator i=
notifiers.begin(); i!=
notifiers.end(); ++i)
131 if (fInitialDownload || pindexNew == pindexFork)
134 for (std::list<CZMQAbstractNotifier*>::iterator i =
notifiers.begin(); i!=
notifiers.end(); )
151 for (std::list<CZMQAbstractNotifier*>::iterator i =
notifiers.begin(); i!=
notifiers.end(); )
172 for (std::list<CZMQAbstractNotifier*>::iterator i =
notifiers.begin(); i!=
notifiers.end(); )
void NewAssetMessage(const CMessage &message) override
bool IsArgSet(const std::string &strArg) const
Return true if the given argument has been manually set.
void TransactionAddedToMempool(const CTransactionRef &tx) override
Notifies listeners of a transaction having been added to mempool.
virtual bool NotifyBlock(const CBlockIndex *pindex)
std::string GetAddress() const
void BlockConnected(const std::shared_ptr< const CBlock > &pblock, const CBlockIndex *pindexConnected, const std::vector< CTransactionRef > &vtxConflicted) override
Notifies listeners of a block being connected.
std::shared_ptr< const CTransaction > CTransactionRef
static CZMQNotificationInterface * Create()
virtual bool NotifyTransaction(const CTransaction &transaction)
virtual ~CZMQNotificationInterface()
void BlockDisconnected(const std::shared_ptr< const CBlock > &pblock) override
Notifies listeners of a block being disconnected.
virtual bool NotifyMessage(const CMessage &message)
void SetAddress(const std::string &a)
virtual void Shutdown()=0
#define LogPrint(category,...)
void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override
Notifies listeners of updated block chain tip.
std::list< CZMQAbstractNotifier * > notifiers
void zmqError(const char *str)
The block chain is a tree shaped structure starting with the genesis block at the root...
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
CZMQAbstractNotifier *(* CZMQNotifierFactory)()
virtual bool Initialize(void *pcontext)=0
The basic transaction that is broadcasted on the network and contained in blocks. ...
CZMQNotificationInterface()
void SetType(const std::string &t)
std::string GetType() const