rpc: reverse the order of listtransactions to align with lbrycrd (2nd attempt)

The previous change doesn't handle the truncated list.
This commit is contained in:
Roy Lee 2022-08-08 17:03:36 -07:00
parent 893a820c65
commit 92acdcbfca

View file

@ -2120,10 +2120,13 @@ func (w *Wallet) ListTransactions(from, count int) ([]btcjson.ListTransactionsRe
// Return newer results first by starting at mempool height and working
// down to the genesis block.
// return w.TxStore.RangeTransactions(txmgrNs, -1, 0, rangeFn)
return w.TxStore.RangeTransactions(txmgrNs, 0, -1, rangeFn)
return w.TxStore.RangeTransactions(txmgrNs, -1, 0, rangeFn)
})
for i, j := 0, len(txList)-1; i < j; i, j = i+1, j-1 {
txList[i], txList[j] = txList[j], txList[i]
}
return txList, err
}