Skip to content

Commit

Permalink
rpc: reverse the order of listtransactions to align with lbrycrd (2nd…
Browse files Browse the repository at this point in the history
… attempt)

The previous change doesn't handle the truncated list.
  • Loading branch information
roylee17 committed Aug 9, 2022
1 parent 893a820 commit 92acdcb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions wallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 92acdcb

Please sign in to comment.