[RPC] Give RPC commands more information about the RPC request

This commit is contained in:
Jonas Schnelli
2016-09-22 09:46:41 +02:00
parent 23c32a9694
commit 69d1c25768
13 changed files with 558 additions and 547 deletions

View File

@@ -172,19 +172,22 @@ static bool HTTPReq_JSONRPC(HTTPRequest* req, const std::string &)
return false;
}
JSONRequest jreq;
JSONRPCRequest jreq;
try {
// Parse request
UniValue valRequest;
if (!valRequest.read(req->ReadBody()))
throw JSONRPCError(RPC_PARSE_ERROR, "Parse error");
// Set the URI
jreq.URI = req->GetURI();
std::string strReply;
// singleton request
if (valRequest.isObject()) {
jreq.parse(valRequest);
UniValue result = tableRPC.execute(jreq.strMethod, jreq.params);
UniValue result = tableRPC.execute(jreq);
// Send reply
strReply = JSONRPCReply(result, NullUniValue, jreq.id);