p2p: return CSubNet in LookupSubNet

This commit is contained in:
brunoerg
2022-09-13 18:19:40 -03:00
parent 71300489af
commit fb3e812277
8 changed files with 101 additions and 115 deletions

View File

@@ -111,8 +111,7 @@ bool NetWhitelistPermissions::TryParse(const std::string& str, NetWhitelistPermi
if (!TryParsePermissionFlags(str, flags, offset, error)) return false;
const std::string net = str.substr(offset);
CSubNet subnet;
LookupSubNet(net, subnet);
const CSubNet subnet{LookupSubNet(net)};
if (!subnet.IsValid()) {
error = strprintf(_("Invalid netmask specified in -whitelist: '%s'"), net);
return false;