Un-expose mapArgs from utils.h

This commit is contained in:
Matt Corallo
2016-11-29 18:45:24 -08:00
parent 71fde5563b
commit 4cd373aea8
14 changed files with 30 additions and 24 deletions

View File

@@ -95,7 +95,7 @@ static int AppInitRPC(int argc, char* argv[])
return EXIT_SUCCESS;
}
if (!boost::filesystem::is_directory(GetDataDir(false))) {
fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", mapArgs["-datadir"].c_str());
fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", GetArg("-datadir", "").c_str());
return EXIT_FAILURE;
}
try {
@@ -211,7 +211,7 @@ UniValue CallRPC(const std::string& strMethod, const UniValue& params)
// Get credentials
std::string strRPCUserColonPass;
if (mapArgs["-rpcpassword"] == "") {
if (GetArg("-rpcpassword", "") == "") {
// Try fall back to cookie-based authentication if no password is provided
if (!GetAuthCookie(&strRPCUserColonPass)) {
throw std::runtime_error(strprintf(
@@ -220,7 +220,7 @@ UniValue CallRPC(const std::string& strMethod, const UniValue& params)
}
} else {
strRPCUserColonPass = mapArgs["-rpcuser"] + ":" + mapArgs["-rpcpassword"];
strRPCUserColonPass = GetArg("-rpcuser", "") + ":" + GetArg("-rpcpassword", "");
}
struct evkeyvalq *output_headers = evhttp_request_get_output_headers(req);