Skip to content

Commit 71fde55

Browse files
committed
Get rid of mapArgs direct access in ZMQ construction
1 parent 0cf86a6 commit 71fde55

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
12821282
}
12831283

12841284
#if ENABLE_ZMQ
1285-
pzmqNotificationInterface = CZMQNotificationInterface::CreateWithArguments(mapArgs);
1285+
pzmqNotificationInterface = CZMQNotificationInterface::Create();
12861286

12871287
if (pzmqNotificationInterface) {
12881288
RegisterValidationInterface(pzmqNotificationInterface);

src/zmq/zmqnotificationinterface.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ CZMQNotificationInterface::~CZMQNotificationInterface()
2929
}
3030
}
3131

32-
CZMQNotificationInterface* CZMQNotificationInterface::CreateWithArguments(const std::map<std::string, std::string> &args)
32+
CZMQNotificationInterface* CZMQNotificationInterface::Create()
3333
{
3434
CZMQNotificationInterface* notificationInterface = NULL;
3535
std::map<std::string, CZMQNotifierFactory> factories;
@@ -42,11 +42,11 @@ CZMQNotificationInterface* CZMQNotificationInterface::CreateWithArguments(const
4242

4343
for (std::map<std::string, CZMQNotifierFactory>::const_iterator i=factories.begin(); i!=factories.end(); ++i)
4444
{
45-
std::map<std::string, std::string>::const_iterator j = args.find("-zmq" + i->first);
46-
if (j!=args.end())
45+
std::string arg("-zmq" + i->first);
46+
if (IsArgSet(arg))
4747
{
4848
CZMQNotifierFactory factory = i->second;
49-
std::string address = j->second;
49+
std::string address = GetArg(arg, "");
5050
CZMQAbstractNotifier *notifier = factory();
5151
notifier->SetType(i->first);
5252
notifier->SetAddress(address);

src/zmq/zmqnotificationinterface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class CZMQNotificationInterface : public CValidationInterface
1717
public:
1818
virtual ~CZMQNotificationInterface();
1919

20-
static CZMQNotificationInterface* CreateWithArguments(const std::map<std::string, std::string> &args);
20+
static CZMQNotificationInterface* Create();
2121

2222
protected:
2323
bool Initialize();

0 commit comments

Comments
 (0)