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; Ledger::pointer ledger;
if (param == "current") if (param == "current")
ledger = theApp->getMasterLedger().getCurrentLedger(); ledger = theApp->getMasterLedger().getCurrentLedger();
else if (param == "lastclosed") else if ((param == "lastclosed") || (param == "lastaccepted"))
ledger = theApp->getMasterLedger().getClosedLedger(); ledger = theApp->getMasterLedger().getClosedLedger();
else if (param.size() > 12) else if (param.size() > 12)
ledger = theApp->getMasterLedger().getLedgerByHash(uint256(param)); ledger = theApp->getMasterLedger().getLedgerByHash(uint256(param));
@@ -1386,13 +1386,7 @@ Json::Value RPCServer::doLedger(Json::Value& params)
if (!ledger) if (!ledger)
return RPCError(rpcLGR_NOT_FOUND); return RPCError(rpcLGR_NOT_FOUND);
bool full = false; bool full = extractString(param, params, 1) && (param == "full");
if (extractString(param, params, 1))
{
if (param == "full")
full = true;
}
Json::Value ret(Json::objectValue); Json::Value ret(Json::objectValue);
ledger->addJson(ret, full ? LEDGER_JSON_FULL : 0); ledger->addJson(ret, full ? LEDGER_JSON_FULL : 0);
return ret; return ret;

View File

@@ -48,7 +48,7 @@ void printHelp(const po::options_description& desc)
cout << " data_delete <key>" << endl; cout << " data_delete <key>" << endl;
cout << " data_fetch <key>" << endl; cout << " data_fetch <key>" << endl;
cout << " data_store <key> <value>" << endl; cout << " data_store <key> <value>" << endl;
cout << " ledger" << endl; cout << " ledger [<id>|current|lastclosed] [full]" << endl;
cout << " nickname_info <nickname>" << endl; cout << " nickname_info <nickname>" << endl;
cout << " nickname_set <seed> <paying_account> <nickname> [<offer_minimum>] [<authorization>]" << endl; cout << " nickname_set <seed> <paying_account> <nickname> [<offer_minimum>] [<authorization>]" << endl;
cout << " password_fund <seed> <paying_account> [<account>]" << endl; cout << " password_fund <seed> <paying_account> [<account>]" << endl;
@@ -57,7 +57,7 @@ void printHelp(const po::options_description& desc)
cout << " send <seed> <paying_account> <account_id> <amount> [<currency>] [<send_max>] [<send_currency>]" << endl; cout << " send <seed> <paying_account> <account_id> <amount> [<currency>] [<send_max>] [<send_currency>]" << endl;
cout << " stop" << endl; cout << " stop" << endl;
cout << " transit_set <seed> <paying_account> <transit_rate> <starts> <expires>" << endl; cout << " transit_set <seed> <paying_account> <transit_rate> <starts> <expires>" << endl;
cout << " tx" << endl; cout << " tx <id>" << endl;
cout << " unl_add <domain>|<public> [<comment>]" << endl; cout << " unl_add <domain>|<public> [<comment>]" << endl;
cout << " unl_delete <public_key>" << endl; cout << " unl_delete <public_key>" << endl;
cout << " unl_list" << endl; cout << " unl_list" << endl;