Skip to content

Commit 8776787

Browse files
committed
Merge #11301: add m_added_nodes to connman options
35e5c22 remove unused IsArgSet check (Marko Bencun) 6059182 add m_added_nodes to connman options (Marko Bencun) Pull request description: Tree-SHA512: ca4527a964dcda816b32d335e7fe4d0d8a668a83fbc5e4707ee452d00a7089fa59a88c9f2b1ecdf50e673f2a63fc364b23979e0153f91136525eceec10c2ede2
2 parents 94c9015 + 35e5c22 commit 8776787

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

src/init.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,6 +1664,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
16641664
connOptions.m_msgproc = peerLogic.get();
16651665
connOptions.nSendBufferMaxSize = 1000*gArgs.GetArg("-maxsendbuffer", DEFAULT_MAXSENDBUFFER);
16661666
connOptions.nReceiveFloodSize = 1000*gArgs.GetArg("-maxreceivebuffer", DEFAULT_MAXRECEIVEBUFFER);
1667+
connOptions.m_added_nodes = gArgs.GetArgs("-addnode");
16671668

16681669
connOptions.nMaxOutboundTimeframe = nMaxOutboundTimeframe;
16691670
connOptions.nMaxOutboundLimit = nMaxOutboundLimit;
@@ -1694,9 +1695,8 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
16941695
connOptions.vWhitelistedRange.push_back(subnet);
16951696
}
16961697

1697-
if (gArgs.IsArgSet("-seednode")) {
1698-
connOptions.vSeedNodes = gArgs.GetArgs("-seednode");
1699-
}
1698+
connOptions.vSeedNodes = gArgs.GetArgs("-seednode");
1699+
17001700
// Initiate outbound connections unless connect=0
17011701
connOptions.m_use_addrman_outgoing = !gArgs.IsArgSet("-connect");
17021702
if (!connOptions.m_use_addrman_outgoing) {

src/net.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,11 +1900,6 @@ std::vector<AddedNodeInfo> CConnman::GetAddedNodeInfo()
19001900

19011901
void CConnman::ThreadOpenAddedConnections()
19021902
{
1903-
{
1904-
LOCK(cs_vAddedNodes);
1905-
vAddedNodes = gArgs.GetArgs("-addnode");
1906-
}
1907-
19081903
while (true)
19091904
{
19101905
CSemaphoreGrant grant(*semAddnode);

src/net.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ class CConnman
147147
std::vector<CService> vBinds, vWhiteBinds;
148148
bool m_use_addrman_outgoing = true;
149149
std::vector<std::string> m_specified_outgoing;
150+
std::vector<std::string> m_added_nodes;
150151
};
151152

152153
void Init(const Options& connOptions) {
@@ -164,6 +165,7 @@ class CConnman
164165
nMaxOutboundTimeframe = connOptions.nMaxOutboundTimeframe;
165166
nMaxOutboundLimit = connOptions.nMaxOutboundLimit;
166167
vWhitelistedRange = connOptions.vWhitelistedRange;
168+
vAddedNodes = connOptions.m_added_nodes;
167169
}
168170

169171
CConnman(uint64_t seed0, uint64_t seed1);

0 commit comments

Comments
 (0)