net: Split resolving out of CNetAddr

This commit is contained in:
Cory Fields
2016-05-31 13:05:52 -04:00
parent 6caf3ee061
commit 31d6b1d5f0
8 changed files with 153 additions and 119 deletions

View File

@@ -494,8 +494,11 @@ UniValue setban(const UniValue& params, bool fHelp)
if (params[0].get_str().find("/") != string::npos)
isSubnet = true;
if (!isSubnet)
netAddr = CNetAddr(params[0].get_str());
if (!isSubnet) {
CNetAddr resolved;
LookupHost(params[0].get_str().c_str(), resolved, false);
netAddr = resolved;
}
else
subNet = CSubNet(params[0].get_str());