net: Split resolving out of CSubNet

This commit is contained in:
Cory Fields
2016-05-31 15:50:24 -04:00
parent f96c7c4d91
commit b6c3ff3dae
7 changed files with 153 additions and 115 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");