aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/protocol.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpc/protocol.cpp')
-rw-r--r--src/rpc/protocol.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/rpc/protocol.cpp b/src/rpc/protocol.cpp
index ddc1bb6232..0635b757c6 100644
--- a/src/rpc/protocol.cpp
+++ b/src/rpc/protocol.cpp
@@ -26,9 +26,9 @@
UniValue JSONRPCRequestObj(const std::string& strMethod, const UniValue& params, const UniValue& id)
{
UniValue request(UniValue::VOBJ);
- request.push_back(Pair("method", strMethod));
- request.push_back(Pair("params", params));
- request.push_back(Pair("id", id));
+ request.pushKV("method", strMethod);
+ request.pushKV("params", params);
+ request.pushKV("id", id);
return request;
}
@@ -36,11 +36,11 @@ UniValue JSONRPCReplyObj(const UniValue& result, const UniValue& error, const Un
{
UniValue reply(UniValue::VOBJ);
if (!error.isNull())
- reply.push_back(Pair("result", NullUniValue));
+ reply.pushKV("result", NullUniValue);
else
- reply.push_back(Pair("result", result));
- reply.push_back(Pair("error", error));
- reply.push_back(Pair("id", id));
+ reply.pushKV("result", result);
+ reply.pushKV("error", error);
+ reply.pushKV("id", id);
return reply;
}
@@ -53,8 +53,8 @@ std::string JSONRPCReply(const UniValue& result, const UniValue& error, const Un
UniValue JSONRPCError(int code, const std::string& message)
{
UniValue error(UniValue::VOBJ);
- error.push_back(Pair("code", code));
- error.push_back(Pair("message", message));
+ error.pushKV("code", code);
+ error.pushKV("message", message);
return error;
}
@@ -72,9 +72,7 @@ static fs::path GetAuthCookieFile(bool temp=false)
if (temp) {
arg += ".tmp";
}
- fs::path path(arg);
- if (!path.is_complete()) path = GetDataDir() / path;
- return path;
+ return AbsPathForConfigVal(fs::path(arg));
}
bool GenerateAuthCookie(std::string *cookie_out)