diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-10-25 12:26:48 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-10-25 12:27:24 +0200 |
| commit | e1d1f57b56b28b1dd211433fb877f4969af15e52 (patch) | |
| tree | 22c5fc35f182706ea00a0ab301720dd9f3b8d4c2 /src/net.cpp | |
| parent | Merge #9004: Clarify `listenonion` (diff) | |
| parent | Make connect=0 disable automatic outbound connections. (diff) | |
| download | discoin-e1d1f57b56b28b1dd211433fb877f4969af15e52.tar.xz discoin-e1d1f57b56b28b1dd211433fb877f4969af15e52.zip | |
Merge #9002: Make connect=0 disable automatic outbound connections.
515e264 Make connect=0 disable automatic outbound connections. (Gregory Maxwell)
Diffstat (limited to 'src/net.cpp')
| -rw-r--r-- | src/net.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/net.cpp b/src/net.cpp index 1bca168d1..953377a9f 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)))); |