Document 'tx' and 'ledger' commands.

This commit is contained in:
JoelKatz
2012-06-10 15:48:53 -07:00
parent 85d774e7f6
commit f10ea18326
2 changed files with 4 additions and 10 deletions

View File

@@ -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;