mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Document 'tx' and 'ledger' commands.
This commit is contained in:
@@ -1376,7 +1376,7 @@ Json::Value RPCServer::doLedger(Json::Value& params)
|
||||
Ledger::pointer ledger;
|
||||
if (param == "current")
|
||||
ledger = theApp->getMasterLedger().getCurrentLedger();
|
||||
else if (param == "lastclosed")
|
||||
else if ((param == "lastclosed") || (param == "lastaccepted"))
|
||||
ledger = theApp->getMasterLedger().getClosedLedger();
|
||||
else if (param.size() > 12)
|
||||
ledger = theApp->getMasterLedger().getLedgerByHash(uint256(param));
|
||||
@@ -1386,13 +1386,7 @@ Json::Value RPCServer::doLedger(Json::Value& params)
|
||||
if (!ledger)
|
||||
return RPCError(rpcLGR_NOT_FOUND);
|
||||
|
||||
bool full = false;
|
||||
if (extractString(param, params, 1))
|
||||
{
|
||||
if (param == "full")
|
||||
full = true;
|
||||
}
|
||||
|
||||
bool full = extractString(param, params, 1) && (param == "full");
|
||||
Json::Value ret(Json::objectValue);
|
||||
ledger->addJson(ret, full ? LEDGER_JSON_FULL : 0);
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user