mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
[RPC] Give RPC commands more information about the RPC request
This commit is contained in:
parent
23c32a9694
commit
69d1c25768
13 changed files with 558 additions and 547 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue