From a85afbe4095d286faf33641611addff64989e8ac Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Sat, 31 Aug 2013 13:04:50 -0700 Subject: [PATCH] Fix paging in tx_account --- modules/ripple_app/misc/NetworkOPs.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/ripple_app/misc/NetworkOPs.cpp b/modules/ripple_app/misc/NetworkOPs.cpp index 9e628c2a2..88b2b695a 100644 --- a/modules/ripple_app/misc/NetworkOPs.cpp +++ b/modules/ripple_app/misc/NetworkOPs.cpp @@ -1397,8 +1397,6 @@ std::vector NetworkOPs::getAccountTxsB ( } - - uint32 NetworkOPs::countAccountTxs (const RippleAddress& account, int32 minLedger, int32 maxLedger) { @@ -1461,8 +1459,8 @@ NetworkOPs::getTxsAccount (const RippleAddress& account, int32 minLedger, int32 "ORDER BY AccountTransactions.LedgerSeq %s, AccountTransactions.TxnSeq %s, AccountTransactions.TransID %s " "LIMIT %u;") % account.humanAccountID() - % minLedger - % maxLedger + % ((forward && (findLedger != 0)) ? findLedger : minLedger) + % ((!forward && (findLedger != 0)) ? findLedger: maxLedger) % (forward ? "ASC" : "DESC") % (forward ? "ASC" : "DESC") % (forward ? "ASC" : "DESC") @@ -1570,8 +1568,8 @@ NetworkOPs::getTxsAccountB (const RippleAddress& account, int32 minLedger, int32 "ORDER BY AccountTransactions.LedgerSeq %s, AccountTransactions.TxnSeq %s, AccountTransactions.TransID %s " "LIMIT %u;") % account.humanAccountID() - % minLedger - % maxLedger + % ((forward && (findLedger != 0)) ? findLedger : minLedger) + % ((!forward && (findLedger != 0)) ? findLedger: maxLedger) % (forward ? "ASC" : "DESC") % (forward ? "ASC" : "DESC") % (forward ? "ASC" : "DESC")