mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-26 22:15:52 +00:00
Cleanups to RPC code
This commit is contained in:
committed by
Nik Bougalis
parent
4c7fd18230
commit
22ca13bc78
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user