Changeset View
Changeset View
Standalone View
Standalone View
src/zmq/zmqnotificationinterface.cpp
Show All 36 Lines | CZMQNotificationInterface *CZMQNotificationInterface::Create() { | ||||
factories["pubrawtx"] = | factories["pubrawtx"] = | ||||
CZMQAbstractNotifier::Create<CZMQPublishRawTransactionNotifier>; | CZMQAbstractNotifier::Create<CZMQPublishRawTransactionNotifier>; | ||||
factories["pubsequence"] = | factories["pubsequence"] = | ||||
CZMQAbstractNotifier::Create<CZMQPublishSequenceNotifier>; | CZMQAbstractNotifier::Create<CZMQPublishSequenceNotifier>; | ||||
std::list<std::unique_ptr<CZMQAbstractNotifier>> notifiers; | std::list<std::unique_ptr<CZMQAbstractNotifier>> notifiers; | ||||
for (const auto &entry : factories) { | for (const auto &entry : factories) { | ||||
std::string arg("-zmq" + entry.first); | std::string arg("-zmq" + entry.first); | ||||
if (gArgs.IsArgSet(arg)) { | |||||
const auto &factory = entry.second; | const auto &factory = entry.second; | ||||
const std::string address = gArgs.GetArg(arg, ""); | for (const std::string &address : gArgs.GetArgs(arg)) { | ||||
std::unique_ptr<CZMQAbstractNotifier> notifier = factory(); | std::unique_ptr<CZMQAbstractNotifier> notifier = factory(); | ||||
notifier->SetType(entry.first); | notifier->SetType(entry.first); | ||||
notifier->SetAddress(address); | notifier->SetAddress(address); | ||||
notifier->SetOutboundMessageHighWaterMark( | notifier->SetOutboundMessageHighWaterMark( | ||||
static_cast<int>(gArgs.GetArg( | static_cast<int>(gArgs.GetArg( | ||||
arg + "hwm", CZMQAbstractNotifier::DEFAULT_ZMQ_SNDHWM))); | arg + "hwm", CZMQAbstractNotifier::DEFAULT_ZMQ_SNDHWM))); | ||||
notifiers.push_back(std::move(notifier)); | notifiers.push_back(std::move(notifier)); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 153 Lines • Show Last 20 Lines |