aboutsummaryrefslogtreecommitdiff
path: root/src/httprpc.cpp
diff options
context:
space:
mode:
authorJorge Timón <jtimon@jtimon.cc>2017-03-29 17:51:41 +0200
committerJorge Timón <jtimon@jtimon.cc>2017-06-27 02:54:19 +0200
commit506b700dcb5dd5a7c1d8ffa7c77043a93e4e10de (patch)
tree7f46aa37dccf2c77cb897c00afbede86e40a7f42 /src/httprpc.cpp
parent234ffc677ee58591b139695bf92bbd6f504ee91a (diff)
Util: Remove redundant calls to gArgs.IsArgSet()
Return empty std::vector<std::string> with ArgsManager::GetArgs if nothing is set for that string
Diffstat (limited to 'src/httprpc.cpp')
-rw-r--r--src/httprpc.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/httprpc.cpp b/src/httprpc.cpp
index 053702f843..3f030fce56 100644
--- a/src/httprpc.cpp
+++ b/src/httprpc.cpp
@@ -92,10 +92,8 @@ static bool multiUserAuthorized(std::string strUserPass)
std::string strUser = strUserPass.substr(0, strUserPass.find(":"));
std::string strPass = strUserPass.substr(strUserPass.find(":") + 1);
- if (gArgs.IsArgSet("-rpcauth")) {
+ for (const std::string& strRPCAuth : gArgs.GetArgs("-rpcauth")) {
//Search for multi-user login/pass "rpcauth" from config
- for (std::string strRPCAuth : gArgs.GetArgs("-rpcauth"))
- {
std::vector<std::string> vFields;
boost::split(vFields, strRPCAuth, boost::is_any_of(":$"));
if (vFields.size() != 3) {
@@ -121,7 +119,6 @@ static bool multiUserAuthorized(std::string strUserPass)
if (TimingResistantEqual(strHashFromPass, strHash)) {
return true;
}
- }
}
return false;
}