aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorMarko Bencun <marko.bencun@monetas.net>2017-06-01 11:07:08 +0200
committerMarko Bencun <marko.bencun@monetas.net>2017-06-15 23:06:12 +0200
commitce79f3251851f6177f38009341802e6065cb70af (patch)
tree9ec347e23680be4583838e22a72940ab0cc33422 /src/init.cpp
parentc2ab38bdd57a16e6c708dcc633d9162331c9d311 (diff)
add WhitelistedRange to CConnman::Options
Part of a series of changes to clean up the instantiation of connman by decoupling the command line arguments.
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/init.cpp b/src/init.cpp
index ed7695344d..aedad25bd2 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -1289,16 +1289,6 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
}
}
- if (gArgs.IsArgSet("-whitelist")) {
- for (const std::string& net : gArgs.GetArgs("-whitelist")) {
- CSubNet subnet;
- LookupSubNet(net.c_str(), subnet);
- if (!subnet.IsValid())
- return InitError(strprintf(_("Invalid netmask specified in -whitelist: '%s'"), net));
- connman.AddWhitelistedRange(subnet);
- }
- }
-
// Check for host lookup allowed before parsing any network related parameters
fNameLookup = GetBoolArg("-dns", DEFAULT_NAME_LOOKUP);
@@ -1661,6 +1651,16 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
connOptions.nMaxOutboundTimeframe = nMaxOutboundTimeframe;
connOptions.nMaxOutboundLimit = nMaxOutboundLimit;
+ if (gArgs.IsArgSet("-whitelist")) {
+ for (const auto& net : gArgs.GetArgs("-whitelist")) {
+ CSubNet subnet;
+ LookupSubNet(net.c_str(), subnet);
+ if (!subnet.IsValid())
+ return InitError(strprintf(_("Invalid netmask specified in -whitelist: '%s'"), net));
+ connOptions.vWhitelistedRange.push_back(subnet);
+ }
+ }
+
if (gArgs.IsArgSet("-seednode")) {
connOptions.vSeedNodes = gArgs.GetArgs("-seednode");
}