Util: Remove redundant calls to gArgs.IsArgSet()

Return empty std::vector<std::string> with ArgsManager::GetArgs if
nothing is set for that string
This commit is contained in:
Jorge Timón
2017-03-29 17:51:41 +02:00
parent 234ffc677e
commit 506b700dcb
5 changed files with 16 additions and 37 deletions

View File

@@ -196,8 +196,7 @@ static bool InitHTTPAllowList()
LookupHost("::1", localv6, false);
rpc_allow_subnets.push_back(CSubNet(localv4, 8)); // always allow IPv4 local subnet
rpc_allow_subnets.push_back(CSubNet(localv6)); // always allow IPv6 localhost
if (gArgs.IsArgSet("-rpcallowip")) {
for (const std::string& strAllow : gArgs.GetArgs("-rpcallowip")) {
for (const std::string& strAllow : gArgs.GetArgs("-rpcallowip")) {
CSubNet subnet;
LookupSubNet(strAllow.c_str(), subnet);
if (!subnet.IsValid()) {
@@ -207,7 +206,6 @@ static bool InitHTTPAllowList()
return false;
}
rpc_allow_subnets.push_back(subnet);
}
}
std::string strAllowed;
for (const CSubNet& subnet : rpc_allow_subnets)