net: Split resolving out of CSubNet

This commit is contained in:
Cory Fields
2016-05-31 15:50:24 -04:00
committed by lateminer
parent 116718f5d5
commit 819f4b8dfe
5 changed files with 91 additions and 77 deletions

View File

@@ -1101,7 +1101,8 @@ bool AppInit2(Config& config, boost::thread_group& threadGroup, CScheduler& sche
if (mapArgs.count("-whitelist")) {
BOOST_FOREACH(const std::string& net, mapMultiArgs["-whitelist"]) {
CSubNet subnet(net);
CSubNet subnet;
LookupSubNet(net.c_str(), subnet);
if (!subnet.IsValid())
return InitError(strprintf(_("Invalid netmask specified in -whitelist: '%s'"), net));
CNode::AddWhitelistedRange(subnet);