aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorMarko Bencun <marko.bencun@monetas.net>2017-06-15 09:39:07 +0200
committerMarko Bencun <marko.bencun@monetas.net>2017-07-19 23:34:50 +0200
commit352d582ba240b825cb834cdde041864bafca0e21 (patch)
tree07edcd406696dec9a5e417f103cbf2acf801138c /src/init.cpp
parent7b6e8bc4424006119dc537699c8b3b3121e0b3c3 (diff)
Add vConnect to CConnman::Options
Split the "-connect" argument parsing out of CConnman and put it into AppInitMain().
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp
index d9b98be739..ceea9aa170 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -1651,7 +1651,14 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
if (gArgs.IsArgSet("-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) {
+ const auto connect = gArgs.GetArgs("-connect");
+ if (connect.size() != 1 || connect[0] != "0") {
+ connOptions.m_specified_outgoing = connect;
+ }
+ }
if (!connman.Start(scheduler, connOptions)) {
return false;
}