Changeset View
Changeset View
Standalone View
Standalone View
src/zmq/zmqnotificationinterface.cpp
Show All 34 Lines | factories["pubhashblock"] = | ||||
CZMQAbstractNotifier::Create<CZMQPublishHashBlockNotifier>; | CZMQAbstractNotifier::Create<CZMQPublishHashBlockNotifier>; | ||||
factories["pubhashtx"] = | factories["pubhashtx"] = | ||||
CZMQAbstractNotifier::Create<CZMQPublishHashTransactionNotifier>; | CZMQAbstractNotifier::Create<CZMQPublishHashTransactionNotifier>; | ||||
factories["pubrawblock"] = | factories["pubrawblock"] = | ||||
CZMQAbstractNotifier::Create<CZMQPublishRawBlockNotifier>; | CZMQAbstractNotifier::Create<CZMQPublishRawBlockNotifier>; | ||||
factories["pubrawtx"] = | factories["pubrawtx"] = | ||||
CZMQAbstractNotifier::Create<CZMQPublishRawTransactionNotifier>; | CZMQAbstractNotifier::Create<CZMQPublishRawTransactionNotifier>; | ||||
for (std::map<std::string, CZMQNotifierFactory>::const_iterator i = | for (const auto &entry : factories) { | ||||
factories.begin(); | std::string arg("-zmq" + entry.first); | ||||
i != factories.end(); ++i) { | |||||
std::string arg("-zmq" + i->first); | |||||
if (gArgs.IsArgSet(arg)) { | if (gArgs.IsArgSet(arg)) { | ||||
CZMQNotifierFactory factory = i->second; | CZMQNotifierFactory factory = entry.second; | ||||
std::string address = gArgs.GetArg(arg, ""); | std::string address = gArgs.GetArg(arg, ""); | ||||
CZMQAbstractNotifier *notifier = factory(); | CZMQAbstractNotifier *notifier = factory(); | ||||
notifier->SetType(i->first); | notifier->SetType(entry.first); | ||||
notifier->SetAddress(address); | notifier->SetAddress(address); | ||||
notifiers.push_back(notifier); | notifiers.push_back(notifier); | ||||
} | } | ||||
} | } | ||||
if (!notifiers.empty()) { | if (!notifiers.empty()) { | ||||
notificationInterface = new CZMQNotificationInterface(); | notificationInterface = new CZMQNotificationInterface(); | ||||
notificationInterface->notifiers = notifiers; | notificationInterface->notifiers = notifiers; | ||||
▲ Show 20 Lines • Show All 113 Lines • Show Last 20 Lines |