diff --git a/src/init.cpp b/src/init.cpp index 5153ef0eb7..5910cea0b6 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -2210,6 +2210,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) connOptions.m_msgproc = peerLogic.get(); connOptions.nSendBufferMaxSize = 1000*gArgs.GetArg("-maxsendbuffer", DEFAULT_MAXSENDBUFFER); connOptions.nReceiveFloodSize = 1000*gArgs.GetArg("-maxreceivebuffer", DEFAULT_MAXRECEIVEBUFFER); + connOptions.m_added_nodes = gArgs.GetArgs("-addnode"); connOptions.nMaxOutboundTimeframe = nMaxOutboundTimeframe; connOptions.nMaxOutboundLimit = nMaxOutboundLimit; @@ -2240,9 +2241,8 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) connOptions.vWhitelistedRange.push_back(subnet); } - if (gArgs.IsArgSet("-seednode")) { - connOptions.vSeedNodes = gArgs.GetArgs("-seednode"); - } + connOptions.vSeedNodes = gArgs.GetArgs("-seednode"); + // Initiate outbound connections unless connect=0 connOptions.m_use_addrman_outgoing = !gArgs.IsArgSet("-connect"); if (!connOptions.m_use_addrman_outgoing) { diff --git a/src/net.cpp b/src/net.cpp index 252d079c3a..23551fd69b 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2071,11 +2071,6 @@ std::vector CConnman::GetAddedNodeInfo() void CConnman::ThreadOpenAddedConnections() { - { - LOCK(cs_vAddedNodes); - vAddedNodes = gArgs.GetArgs("-addnode"); - } - while (true) { CSemaphoreGrant grant(*semAddnode); diff --git a/src/net.h b/src/net.h index 177549de63..13177cd227 100644 --- a/src/net.h +++ b/src/net.h @@ -171,6 +171,7 @@ public: std::vector vBinds, vWhiteBinds; bool m_use_addrman_outgoing = true; std::vector m_specified_outgoing; + std::vector m_added_nodes; }; void Init(const Options& connOptions) { @@ -187,6 +188,7 @@ public: nMaxOutboundTimeframe = connOptions.nMaxOutboundTimeframe; nMaxOutboundLimit = connOptions.nMaxOutboundLimit; vWhitelistedRange = connOptions.vWhitelistedRange; + vAddedNodes = connOptions.m_added_nodes; } CConnman(uint64_t seed0, uint64_t seed1);