mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Enable batch rpc processing
* Can be exercised from the command line with json2 * Rewrite Env::do_rpc to call the same code as rpc from the command line. This puts rpc handling logic in one place.
This commit is contained in:
@@ -465,31 +465,7 @@ Env::st (JTx const& jt)
|
||||
Json::Value
|
||||
Env::do_rpc(std::vector<std::string> const& args)
|
||||
{
|
||||
auto jv = cmdLineToJSONRPC(args, journal);
|
||||
if (!jv.isMember(jss::jsonrpc))
|
||||
{
|
||||
jv[jss::jsonrpc] = "2.0";
|
||||
jv[jss::ripplerpc] = "2.0";
|
||||
jv[jss::id] = 5;
|
||||
}
|
||||
auto response = client().invoke(
|
||||
jv[jss::method].asString(),
|
||||
jv[jss::params][0U]);
|
||||
|
||||
if (jv.isMember(jss::jsonrpc))
|
||||
{
|
||||
response[jss::jsonrpc] = jv[jss::jsonrpc];
|
||||
response[jss::ripplerpc] = jv[jss::ripplerpc];
|
||||
response[jss::id] = jv[jss::id];
|
||||
}
|
||||
|
||||
if (jv[jss::params][0u].isMember(jss::error) &&
|
||||
(! response.isMember(jss::error)))
|
||||
{
|
||||
response["client_error"] = jv[jss::params][0u];
|
||||
}
|
||||
|
||||
return response;
|
||||
return rpcClient(args, app().config(), app().logs()).second;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user