From 71fde5563b5d05a63e3ad08a3c32a9e5ffb952f7 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 29 Nov 2016 18:43:29 -0800 Subject: Get rid of mapArgs direct access in ZMQ construction --- src/init.cpp | 2 +- src/zmq/zmqnotificationinterface.cpp | 8 ++++---- src/zmq/zmqnotificationinterface.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 778d66fba8..76ef08da39 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1282,7 +1282,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) } #if ENABLE_ZMQ - pzmqNotificationInterface = CZMQNotificationInterface::CreateWithArguments(mapArgs); + pzmqNotificationInterface = CZMQNotificationInterface::Create(); if (pzmqNotificationInterface) { RegisterValidationInterface(pzmqNotificationInterface); diff --git a/src/zmq/zmqnotificationinterface.cpp b/src/zmq/zmqnotificationinterface.cpp index a7e20a8356..2f5efcb4db 100644 --- a/src/zmq/zmqnotificationinterface.cpp +++ b/src/zmq/zmqnotificationinterface.cpp @@ -29,7 +29,7 @@ CZMQNotificationInterface::~CZMQNotificationInterface() } } -CZMQNotificationInterface* CZMQNotificationInterface::CreateWithArguments(const std::map &args) +CZMQNotificationInterface* CZMQNotificationInterface::Create() { CZMQNotificationInterface* notificationInterface = NULL; std::map factories; @@ -42,11 +42,11 @@ CZMQNotificationInterface* CZMQNotificationInterface::CreateWithArguments(const for (std::map::const_iterator i=factories.begin(); i!=factories.end(); ++i) { - std::map::const_iterator j = args.find("-zmq" + i->first); - if (j!=args.end()) + std::string arg("-zmq" + i->first); + if (IsArgSet(arg)) { CZMQNotifierFactory factory = i->second; - std::string address = j->second; + std::string address = GetArg(arg, ""); CZMQAbstractNotifier *notifier = factory(); notifier->SetType(i->first); notifier->SetAddress(address); diff --git a/src/zmq/zmqnotificationinterface.h b/src/zmq/zmqnotificationinterface.h index 037470ec17..585554ccd2 100644 --- a/src/zmq/zmqnotificationinterface.h +++ b/src/zmq/zmqnotificationinterface.h @@ -17,7 +17,7 @@ class CZMQNotificationInterface : public CValidationInterface public: virtual ~CZMQNotificationInterface(); - static CZMQNotificationInterface* CreateWithArguments(const std::map &args); + static CZMQNotificationInterface* Create(); protected: bool Initialize(); -- cgit v1.2.3