Skip to content

Commit 13fd27d

Browse files
committed
Fix indentation after 'Remove redundant calls to gArgs.IsArgSet()'
1 parent a4114f3 commit 13fd27d

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

src/httpserver.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -210,15 +210,15 @@ static bool InitHTTPAllowList()
210210
rpc_allow_subnets.emplace_back(localv4, 8); // always allow IPv4 local subnet
211211
rpc_allow_subnets.emplace_back(localv6); // always allow IPv6 localhost
212212
for (const std::string& strAllow : gArgs.GetArgs("-rpcallowip")) {
213-
CSubNet subnet;
214-
LookupSubNet(strAllow.c_str(), subnet);
215-
if (!subnet.IsValid()) {
216-
uiInterface.ThreadSafeMessageBox(
217-
strprintf("Invalid -rpcallowip subnet specification: %s. Valid are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24).", strAllow),
218-
"", CClientUIInterface::MSG_ERROR);
219-
return false;
220-
}
221-
rpc_allow_subnets.push_back(subnet);
213+
CSubNet subnet;
214+
LookupSubNet(strAllow.c_str(), subnet);
215+
if (!subnet.IsValid()) {
216+
uiInterface.ThreadSafeMessageBox(
217+
strprintf("Invalid -rpcallowip subnet specification: %s. Valid are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24).", strAllow),
218+
"", CClientUIInterface::MSG_ERROR);
219+
return false;
220+
}
221+
rpc_allow_subnets.push_back(subnet);
222222
}
223223
std::string strAllowed;
224224
for (const CSubNet& subnet : rpc_allow_subnets)

src/init.cpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,9 +1026,9 @@ bool AppInit2()
10261026

10271027
// Now remove the logging categories which were explicitly excluded
10281028
for (const std::string& cat : gArgs.GetArgs("-debugexclude")) {
1029-
if (!g_logger->DisableCategory(cat)) {
1030-
UIWarning(strprintf(_("Unsupported logging category %s=%s."), "-debugexclude", cat));
1031-
}
1029+
if (!g_logger->DisableCategory(cat)) {
1030+
UIWarning(strprintf(_("Unsupported logging category %s=%s."), "-debugexclude", cat));
1031+
}
10321032
}
10331033

10341034
// Check for -debugnet
@@ -1363,11 +1363,11 @@ bool AppInit2()
13631363
}
13641364

13651365
for (const auto& net : gArgs.GetArgs("-whitelist")) {
1366-
CSubNet subnet;
1367-
LookupSubNet(net.c_str(), subnet);
1368-
if (!subnet.IsValid())
1369-
return UIError(strprintf(_("Invalid netmask specified in -whitelist: '%s'"), net));
1370-
connman.AddWhitelistedRange(subnet);
1366+
CSubNet subnet;
1367+
LookupSubNet(net.c_str(), subnet);
1368+
if (!subnet.IsValid())
1369+
return UIError(strprintf(_("Invalid netmask specified in -whitelist: '%s'"), net));
1370+
connman.AddWhitelistedRange(subnet);
13711371
}
13721372

13731373
// Check for host lookup allowed before parsing any network related parameters
@@ -1422,18 +1422,18 @@ bool AppInit2()
14221422
bool fBound = false;
14231423
if (fListen) {
14241424
for (const std::string& strBind : gArgs.GetArgs("-bind")) {
1425-
CService addrBind;
1426-
if (!Lookup(strBind.c_str(), addrBind, GetListenPort(), false))
1427-
return UIError(ResolveErrMsg("bind", strBind));
1428-
fBound |= Bind(connman, addrBind, (BF_EXPLICIT | BF_REPORT_ERROR));
1425+
CService addrBind;
1426+
if (!Lookup(strBind.c_str(), addrBind, GetListenPort(), false))
1427+
return UIError(ResolveErrMsg("bind", strBind));
1428+
fBound |= Bind(connman, addrBind, (BF_EXPLICIT | BF_REPORT_ERROR));
14291429
}
14301430
for (const std::string& strBind : gArgs.GetArgs("-whitebind")) {
1431-
CService addrBind;
1432-
if (!Lookup(strBind.c_str(), addrBind, 0, false))
1433-
return UIError(ResolveErrMsg("whitebind", strBind));
1434-
if (addrBind.GetPort() == 0)
1435-
return UIError(strprintf(_("Need to specify a port with -whitebind: '%s'"), strBind));
1436-
fBound |= Bind(connman, addrBind, (BF_EXPLICIT | BF_REPORT_ERROR | BF_WHITELIST));
1431+
CService addrBind;
1432+
if (!Lookup(strBind.c_str(), addrBind, 0, false))
1433+
return UIError(ResolveErrMsg("whitebind", strBind));
1434+
if (addrBind.GetPort() == 0)
1435+
return UIError(strprintf(_("Need to specify a port with -whitebind: '%s'"), strBind));
1436+
fBound |= Bind(connman, addrBind, (BF_EXPLICIT | BF_REPORT_ERROR | BF_WHITELIST));
14371437
}
14381438
if (!gArgs.IsArgSet("-bind") && !gArgs.IsArgSet("-whitebind")) {
14391439
struct in_addr inaddr_any;
@@ -1446,11 +1446,11 @@ bool AppInit2()
14461446
}
14471447

14481448
for (const std::string& strAddr : gArgs.GetArgs("-externalip")) {
1449-
CService addrLocal;
1450-
if (Lookup(strAddr.c_str(), addrLocal, GetListenPort(), fNameLookup) && addrLocal.IsValid())
1451-
AddLocal(addrLocal,LOCAL_MANUAL);
1452-
else
1453-
return UIError(ResolveErrMsg("externalip", strAddr));
1449+
CService addrLocal;
1450+
if (Lookup(strAddr.c_str(), addrLocal, GetListenPort(), fNameLookup) && addrLocal.IsValid())
1451+
AddLocal(addrLocal, LOCAL_MANUAL);
1452+
else
1453+
return UIError(ResolveErrMsg("externalip", strAddr));
14541454
}
14551455

14561456
if (gArgs.IsArgSet("-seednode")) {

0 commit comments

Comments
 (0)