9 #include <validation.h> 26 for (std::list<CZMQAbstractNotifier*>::iterator i=
notifiers.begin(); i!=
notifiers.end(); ++i)
35 std::map<std::string, CZMQNotifierFactory> factories;
36 std::list<CZMQAbstractNotifier*>
notifiers;
38 factories[
"pubhashblock"] = CZMQAbstractNotifier::Create<CZMQPublishHashBlockNotifier>;
39 factories[
"pubhashtx"] = CZMQAbstractNotifier::Create<CZMQPublishHashTransactionNotifier>;
40 factories[
"pubrawblock"] = CZMQAbstractNotifier::Create<CZMQPublishRawBlockNotifier>;
41 factories[
"pubrawtx"] = CZMQAbstractNotifier::Create<CZMQPublishRawTransactionNotifier>;
43 for (
const auto& entry : factories)
45 std::string arg(
"-zmq" + entry.first);
53 notifiers.push_back(notifier);
57 if (!notifiers.empty())
64 delete notificationInterface;
65 notificationInterface =
nullptr;
69 return notificationInterface;
82 zmqError(
"Unable to initialize context");
86 std::list<CZMQAbstractNotifier*>::iterator i=
notifiers.begin();
115 for (std::list<CZMQAbstractNotifier*>::iterator i=
notifiers.begin(); i!=
notifiers.end(); ++i)
129 if (fInitialDownload || pindexNew == pindexFork)
132 for (std::list<CZMQAbstractNotifier*>::iterator i =
notifiers.begin(); i!=
notifiers.end(); )
153 for (std::list<CZMQAbstractNotifier*>::iterator i =
notifiers.begin(); i!=
notifiers.end(); )
void TransactionAddedToMempool(const CTransactionRef &tx) override
Notifies listeners of a transaction having been added to mempool.
bool IsArgSet(const std::string &strArg)
Return true if the given argument has been manually set.
virtual bool NotifyBlock(const CBlockIndex *pindex)
assert(len-trim+(2 *lenIndices)<=WIDTH)
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.
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)
Return string argument or default value.
std::string GetAddress() const
std::string GetType() const
CZMQAbstractNotifier *(* CZMQNotifierFactory)()
virtual bool Initialize(void *pcontext)=0
struct evm_uint160be address(struct evm_env *env)
The basic transaction that is broadcasted on the network and contained in blocks. ...
CZMQNotificationInterface()
void SetType(const std::string &t)