Cleanups to RPC code

This commit is contained in:
Tom Ritchford
2014-08-03 18:42:00 -04:00
committed by Nik Bougalis
parent 4c7fd18230
commit 22ca13bc78
35 changed files with 402 additions and 477 deletions

View File

@@ -44,6 +44,7 @@ Json::Value doTx (RPC::Context& context)
return rpcError (rpcTXN_NOT_FOUND);
#ifdef READY_FOR_NEW_TX_FORMAT
// TODO(tom): what new format is this?
Json::Value ret;
ret[jss::transaction] = txn->getJson (0, binary);
#else
@@ -52,12 +53,9 @@ Json::Value doTx (RPC::Context& context)
if (txn->getLedger () != 0)
{
auto lgr = context.netOps_.getLedgerBySeq (txn->getLedger ());
if (lgr)
if (auto lgr = context.netOps_.getLedgerBySeq (txn->getLedger ()))
{
bool okay = false;
if (binary)
{
std::string meta;
@@ -71,7 +69,6 @@ Json::Value doTx (RPC::Context& context)
else
{
TransactionMetaSet::pointer set;
if (lgr->getTransactionMeta (txid, set))
{
okay = true;