Don't return marker in account_tx when past user specified window (#282)

This commit is contained in:
Francis Mendoza
2022-10-04 07:35:38 -07:00
committed by GitHub
parent a885551006
commit 4c9c606202

View File

@@ -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