aboutsummaryrefslogtreecommitdiff
path: root/src/httpserver.cpp
diff options
context:
space:
mode:
authorJorge Timón <jtimon@jtimon.cc>2017-05-07 19:37:54 +0200
committerJorge Timón <jtimon@jtimon.cc>2017-05-09 21:37:34 +0200
commit78da882edd54ed62f4a0035590460a97cb9ff282 (patch)
treebe0f8a6490e4904b8b53ec0694a3da3c26ad2d06 /src/httpserver.cpp
parent52922456b86b98ea89b1deb672e1b5ac506c1ba3 (diff)
Util: Small improvements in gArgs usage
- Don't check gArgs.IsArgSet() is greater than 0 - Remove unneeded calls and local variables
Diffstat (limited to 'src/httpserver.cpp')
-rw-r--r--src/httpserver.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/httpserver.cpp b/src/httpserver.cpp
index 6d1d7ac774..0d1cba3fd2 100644
--- a/src/httpserver.cpp
+++ b/src/httpserver.cpp
@@ -197,8 +197,7 @@ static bool InitHTTPAllowList()
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")) {
- const std::vector<std::string>& vAllow = gArgs.GetArgs("-rpcallowip");
- for (std::string strAllow : vAllow) {
+ for (const std::string& strAllow : gArgs.GetArgs("-rpcallowip")) {
CSubNet subnet;
LookupSubNet(strAllow.c_str(), subnet);
if (!subnet.IsValid()) {
@@ -322,11 +321,10 @@ static bool HTTPBindAddresses(struct evhttp* http)
LogPrintf("WARNING: option -rpcbind was ignored because -rpcallowip was not specified, refusing to allow everyone to connect\n");
}
} else if (gArgs.IsArgSet("-rpcbind")) { // Specific bind address
- const std::vector<std::string>& vbind = gArgs.GetArgs("-rpcbind");
- for (std::vector<std::string>::const_iterator i = vbind.begin(); i != vbind.end(); ++i) {
+ for (const std::string& strRPCBind : gArgs.GetArgs("-rpcbind")) {
int port = defaultPort;
std::string host;
- SplitHostPort(*i, port, host);
+ SplitHostPort(strRPCBind, port, host);
endpoints.push_back(std::make_pair(host, port));
}
} else { // No specific bind address specified, bind to any