Merge #11301: add m_added_nodes to connman options

35e5c2269 remove unused IsArgSet check (Marko Bencun)
605918272 add m_added_nodes to connman options (Marko Bencun)

Pull request description:

Tree-SHA512: ca4527a964dcda816b32d335e7fe4d0d8a668a83fbc5e4707ee452d00a7089fa59a88c9f2b1ecdf50e673f2a63fc364b23979e0153f91136525eceec10c2ede2
This commit is contained in:
Pieter Wuille 2017-09-22 14:58:52 -07:00 committed by Pasta
parent df1366f384
commit 3ba12f24a1
3 changed files with 5 additions and 8 deletions

View File

@ -2210,6 +2210,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
connOptions.m_msgproc = peerLogic.get(); connOptions.m_msgproc = peerLogic.get();
connOptions.nSendBufferMaxSize = 1000*gArgs.GetArg("-maxsendbuffer", DEFAULT_MAXSENDBUFFER); connOptions.nSendBufferMaxSize = 1000*gArgs.GetArg("-maxsendbuffer", DEFAULT_MAXSENDBUFFER);
connOptions.nReceiveFloodSize = 1000*gArgs.GetArg("-maxreceivebuffer", DEFAULT_MAXRECEIVEBUFFER); connOptions.nReceiveFloodSize = 1000*gArgs.GetArg("-maxreceivebuffer", DEFAULT_MAXRECEIVEBUFFER);
connOptions.m_added_nodes = gArgs.GetArgs("-addnode");
connOptions.nMaxOutboundTimeframe = nMaxOutboundTimeframe; connOptions.nMaxOutboundTimeframe = nMaxOutboundTimeframe;
connOptions.nMaxOutboundLimit = nMaxOutboundLimit; connOptions.nMaxOutboundLimit = nMaxOutboundLimit;
@ -2240,9 +2241,8 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
connOptions.vWhitelistedRange.push_back(subnet); 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 // Initiate outbound connections unless connect=0
connOptions.m_use_addrman_outgoing = !gArgs.IsArgSet("-connect"); connOptions.m_use_addrman_outgoing = !gArgs.IsArgSet("-connect");
if (!connOptions.m_use_addrman_outgoing) { if (!connOptions.m_use_addrman_outgoing) {

View File

@ -2071,11 +2071,6 @@ std::vector<AddedNodeInfo> CConnman::GetAddedNodeInfo()
void CConnman::ThreadOpenAddedConnections() void CConnman::ThreadOpenAddedConnections()
{ {
{
LOCK(cs_vAddedNodes);
vAddedNodes = gArgs.GetArgs("-addnode");
}
while (true) while (true)
{ {
CSemaphoreGrant grant(*semAddnode); CSemaphoreGrant grant(*semAddnode);

View File

@ -171,6 +171,7 @@ public:
std::vector<CService> vBinds, vWhiteBinds; std::vector<CService> vBinds, vWhiteBinds;
bool m_use_addrman_outgoing = true; bool m_use_addrman_outgoing = true;
std::vector<std::string> m_specified_outgoing; std::vector<std::string> m_specified_outgoing;
std::vector<std::string> m_added_nodes;
}; };
void Init(const Options& connOptions) { void Init(const Options& connOptions) {
@ -187,6 +188,7 @@ public:
nMaxOutboundTimeframe = connOptions.nMaxOutboundTimeframe; nMaxOutboundTimeframe = connOptions.nMaxOutboundTimeframe;
nMaxOutboundLimit = connOptions.nMaxOutboundLimit; nMaxOutboundLimit = connOptions.nMaxOutboundLimit;
vWhitelistedRange = connOptions.vWhitelistedRange; vWhitelistedRange = connOptions.vWhitelistedRange;
vAddedNodes = connOptions.m_added_nodes;
} }
CConnman(uint64_t seed0, uint64_t seed1); CConnman(uint64_t seed0, uint64_t seed1);