mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-03-12 05:31:14 +00:00
Get rid of mapArgs direct access in ZMQ construction
This commit is contained in:
parent
0cf86a6678
commit
71fde5563b
@ -1282,7 +1282,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_ZMQ
|
#if ENABLE_ZMQ
|
||||||
pzmqNotificationInterface = CZMQNotificationInterface::CreateWithArguments(mapArgs);
|
pzmqNotificationInterface = CZMQNotificationInterface::Create();
|
||||||
|
|
||||||
if (pzmqNotificationInterface) {
|
if (pzmqNotificationInterface) {
|
||||||
RegisterValidationInterface(pzmqNotificationInterface);
|
RegisterValidationInterface(pzmqNotificationInterface);
|
||||||
|
@ -29,7 +29,7 @@ CZMQNotificationInterface::~CZMQNotificationInterface()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CZMQNotificationInterface* CZMQNotificationInterface::CreateWithArguments(const std::map<std::string, std::string> &args)
|
CZMQNotificationInterface* CZMQNotificationInterface::Create()
|
||||||
{
|
{
|
||||||
CZMQNotificationInterface* notificationInterface = NULL;
|
CZMQNotificationInterface* notificationInterface = NULL;
|
||||||
std::map<std::string, CZMQNotifierFactory> factories;
|
std::map<std::string, CZMQNotifierFactory> factories;
|
||||||
@ -42,11 +42,11 @@ CZMQNotificationInterface* CZMQNotificationInterface::CreateWithArguments(const
|
|||||||
|
|
||||||
for (std::map<std::string, CZMQNotifierFactory>::const_iterator i=factories.begin(); i!=factories.end(); ++i)
|
for (std::map<std::string, CZMQNotifierFactory>::const_iterator i=factories.begin(); i!=factories.end(); ++i)
|
||||||
{
|
{
|
||||||
std::map<std::string, std::string>::const_iterator j = args.find("-zmq" + i->first);
|
std::string arg("-zmq" + i->first);
|
||||||
if (j!=args.end())
|
if (IsArgSet(arg))
|
||||||
{
|
{
|
||||||
CZMQNotifierFactory factory = i->second;
|
CZMQNotifierFactory factory = i->second;
|
||||||
std::string address = j->second;
|
std::string address = GetArg(arg, "");
|
||||||
CZMQAbstractNotifier *notifier = factory();
|
CZMQAbstractNotifier *notifier = factory();
|
||||||
notifier->SetType(i->first);
|
notifier->SetType(i->first);
|
||||||
notifier->SetAddress(address);
|
notifier->SetAddress(address);
|
||||||
|
@ -17,7 +17,7 @@ class CZMQNotificationInterface : public CValidationInterface
|
|||||||
public:
|
public:
|
||||||
virtual ~CZMQNotificationInterface();
|
virtual ~CZMQNotificationInterface();
|
||||||
|
|
||||||
static CZMQNotificationInterface* CreateWithArguments(const std::map<std::string, std::string> &args);
|
static CZMQNotificationInterface* Create();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool Initialize();
|
bool Initialize();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user