diff --git a/src/RPCServer.cpp b/src/RPCServer.cpp index 6f995a0e7c..48707d4360 100644 --- a/src/RPCServer.cpp +++ b/src/RPCServer.cpp @@ -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; diff --git a/src/main.cpp b/src/main.cpp index 7d2e6df332..4c6bc5213e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -48,7 +48,7 @@ void printHelp(const po::options_description& desc) cout << " data_delete " << endl; cout << " data_fetch " << endl; cout << " data_store " << endl; - cout << " ledger" << endl; + cout << " ledger [|current|lastclosed] [full]" << endl; cout << " nickname_info " << endl; cout << " nickname_set [] []" << endl; cout << " password_fund []" << endl; @@ -57,7 +57,7 @@ void printHelp(const po::options_description& desc) cout << " send [] [] []" << endl; cout << " stop" << endl; cout << " transit_set " << endl; - cout << " tx" << endl; + cout << " tx " << endl; cout << " unl_add | []" << endl; cout << " unl_delete " << endl; cout << " unl_list" << endl;