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

@@ -500,7 +500,7 @@ UniValue setban(const UniValue& params, bool fHelp)
netAddr = resolved;
}
else
subNet = CSubNet(params[0].get_str());
LookupSubNet(params[0].get_str().c_str(), subNet);
if (! (isSubnet ? subNet.IsValid() : netAddr.IsValid()) )
throw JSONRPCError(RPC_CLIENT_NODE_ALREADY_ADDED, "Error: Invalid IP/Subnet");