mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Comments.
This commit is contained in:
@@ -2226,9 +2226,12 @@ Json::Value RPCHandler::doUnsubscribe(Json::Value jvRequest)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Provide the JSON-RPC "result" value.
|
// Provide the JSON-RPC "result" value.
|
||||||
Json::Value RPCHandler::doRpcCommand(const std::string& strCommand, Json::Value& jvParams, int iRole)
|
//
|
||||||
|
// JSON-RPC provides a method and an array of params. JSON-RPC is used as a transport for a command and a request object. The
|
||||||
|
// command is the method. The request object is supplied as the first element of the params.
|
||||||
|
Json::Value RPCHandler::doRpcCommand(const std::string& strMethod, Json::Value& jvParams, int iRole)
|
||||||
{
|
{
|
||||||
// cLog(lsTRACE) << "doRpcCommand:" << strCommand << ":" << jvParams;
|
// cLog(lsTRACE) << "doRpcCommand:" << strMethod << ":" << jvParams;
|
||||||
|
|
||||||
if (!jvParams.isArray() || jvParams.size() < 1)
|
if (!jvParams.isArray() || jvParams.size() < 1)
|
||||||
return rpcError(rpcINVALID_PARAMS);
|
return rpcError(rpcINVALID_PARAMS);
|
||||||
@@ -2238,7 +2241,8 @@ Json::Value RPCHandler::doRpcCommand(const std::string& strCommand, Json::Value&
|
|||||||
if (!jvRequest.isObject() || !jvRequest.isMember("command"))
|
if (!jvRequest.isObject() || !jvRequest.isMember("command"))
|
||||||
return rpcError(rpcINVALID_PARAMS);
|
return rpcError(rpcINVALID_PARAMS);
|
||||||
|
|
||||||
jvRequest["command"] = strCommand;
|
// Provide the JSON-RPC method as the field "command" in the request.
|
||||||
|
jvRequest["command"] = strMethod;
|
||||||
|
|
||||||
Json::Value jvResult = doCommand(jvRequest, iRole);
|
Json::Value jvResult = doCommand(jvRequest, iRole);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user