aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2016-10-24 01:21:04 +0000
committerGregory Maxwell <greg@xiph.org>2016-10-25 06:17:43 +0000
commit515e2642eb45bda56156b1213b25fb4886d3fdbe (patch)
treebf617d9ee69354546bff5f947ef4bf673caaff94 /src/net.cpp
parentf08222e882b18c1f279308636e03beceece2dbf1 (diff)
Make connect=0 disable automatic outbound connections.
Otherwise it just responds to this obvious bit of configuration by trying to connect to "0" in a loop.
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 1bca168d1d..953377a9f0 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -2138,8 +2138,9 @@ bool CConnman::Start(boost::thread_group& threadGroup, CScheduler& scheduler, st
// Initiate outbound connections from -addnode
threadGroup.create_thread(boost::bind(&TraceThread<boost::function<void()> >, "addcon", boost::function<void()>(boost::bind(&CConnman::ThreadOpenAddedConnections, this))));
- // Initiate outbound connections
- threadGroup.create_thread(boost::bind(&TraceThread<boost::function<void()> >, "opencon", boost::function<void()>(boost::bind(&CConnman::ThreadOpenConnections, this))));
+ // Initiate outbound connections unless connect=0
+ if (!mapArgs.count("-connect") || mapMultiArgs["-connect"].size() != 1 || mapMultiArgs["-connect"][0] != "0")
+ threadGroup.create_thread(boost::bind(&TraceThread<boost::function<void()> >, "opencon", boost::function<void()>(boost::bind(&CConnman::ThreadOpenConnections, this))));
// Process messages
threadGroup.create_thread(boost::bind(&TraceThread<boost::function<void()> >, "msghand", boost::function<void()>(boost::bind(&CConnman::ThreadMessageHandler, this))));