0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-21 12:22:50 -05:00

Fix nonsensical -norpcwhitelist behavior

Treat specifying -norpcwhitelist the same as not specifying -rpcwhitelist,
instead of behaving almost the same but flipping the default
-rpcwhitelistdefault value.

This is confusing because before this change if -norpcwhitelist was specified
it would block users from calling any RPC methods.
This commit is contained in:
Ryan Ofsky 2019-12-19 18:00:04 -05:00
parent e03409c70f
commit 6768389917

View file

@ -334,7 +334,7 @@ static bool InitRPCAuthentication()
}
}
g_rpc_whitelist_default = gArgs.GetBoolArg("-rpcwhitelistdefault", gArgs.IsArgSet("-rpcwhitelist"));
g_rpc_whitelist_default = gArgs.GetBoolArg("-rpcwhitelistdefault", !gArgs.GetArgs("-rpcwhitelist").empty());
for (const std::string& strRPCWhitelist : gArgs.GetArgs("-rpcwhitelist")) {
auto pos = strRPCWhitelist.find(':');
std::string strUser = strRPCWhitelist.substr(0, pos);