diff --git a/src/rpc/RPCHelpers.cpp b/src/rpc/RPCHelpers.cpp index 6d373a2b3..bfe29b86d 100644 --- a/src/rpc/RPCHelpers.cpp +++ b/src/rpc/RPCHelpers.cpp @@ -1646,8 +1646,13 @@ traverseTransactions( for (auto const& txnPlusMeta : blobs) { - if (txnPlusMeta.ledgerSequence < minIndex || - txnPlusMeta.ledgerSequence > maxIndex) + if ((txnPlusMeta.ledgerSequence < minIndex && !forward) || + (txnPlusMeta.ledgerSequence > maxIndex && forward)) + { + response.erase(JS(marker)); + break; + } + else if (txnPlusMeta.ledgerSequence > maxIndex && !forward) { BOOST_LOG_TRIVIAL(debug) << __func__ @@ -1674,13 +1679,11 @@ traverseTransactions( obj[JS(date)] = txnPlusMeta.date; } obj[JS(validated)] = true; - txns.push_back(obj); } response[JS(ledger_index_min)] = minIndex; response[JS(ledger_index_max)] = maxIndex; - response[JS(transactions)] = txns; BOOST_LOG_TRIVIAL(info) @@ -1693,4 +1696,4 @@ traverseTransactions( return response; } -} // namespace RPC +} // namespace RPC \ No newline at end of file