Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion wallet/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"context"
"fmt"
"runtime"
"slices"
"sync"

"decred.org/dcrwallet/v5/errors"
Expand Down Expand Up @@ -671,7 +672,7 @@ Bsearch:
if err != nil {
return 0, err
}
for i := len(addrs) - 1; i >= 0; i-- {
for i, v := range slices.Backward(addrs) {
if existsBits.Get(i) {
lastUsed = mid*scanLen + uint32(i)
lo = mid + 1
Expand Down
8 changes: 4 additions & 4 deletions wallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -2569,7 +2569,7 @@ func (w *Wallet) ListTransactions(ctx context.Context, from, count int) ([]types
// This does nothing for unmined transactions, which are
// unsorted, but it will process mined transactions in the
// reverse order they were marked mined.
for i := len(details) - 1; i >= 0; i-- {
for _, v := range slices.Backward(details) {
if n >= count {
return true, nil
}
Expand All @@ -2579,7 +2579,7 @@ func (w *Wallet) ListTransactions(ctx context.Context, from, count int) ([]types
continue
}

sends, receives := listTransactions(dbtx, &details[i],
sends, receives := listTransactions(dbtx, &v,
w.manager, tipHeight, w.chainParams)
txList = append(txList, sends...)
txList = append(txList, receives...)
Expand Down Expand Up @@ -2669,8 +2669,8 @@ func (w *Wallet) ListAllTransactions(ctx context.Context) ([]types.ListTransacti
// which are unsorted, but it will process mined
// transactions in the reverse order they were marked
// mined.
for i := len(details) - 1; i >= 0; i-- {
sends, receives := listTransactions(dbtx, &details[i],
for _, v := range slices.Backward(details) {
sends, receives := listTransactions(dbtx, &v,
w.manager, tipHeight, w.chainParams)
txList = append(txList, sends...)
txList = append(txList, receives...)
Expand Down