From 4c9c6062023c9bef0b42d55f7ee28739701bfe5c Mon Sep 17 00:00:00 2001 From: Francis Mendoza Date: Tue, 4 Oct 2022 07:35:38 -0700 Subject: [PATCH] Don't return marker in account_tx when past user specified window (#282) --- src/rpc/RPCHelpers.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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