Skip to content

Commit

Permalink
wallet: fix variable misuse
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjan committed Jan 30, 2024
1 parent 7db0d6d commit 22a9296
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions wallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ func (sw *SingleAddressWallet) Redistribute(outputs int, amount, feePerByte type
usable = append(usable, sce)
}
}
utxos = usable

// return early if we don't have to defrag at all
if outputs <= 0 {
Expand All @@ -512,8 +513,8 @@ func (sw *SingleAddressWallet) Redistribute(outputs int, amount, feePerByte type
}()

// desc sort
sort.Slice(usable, func(i, j int) bool {
return usable[i].SiacoinOutput.Value.Cmp(utxos[j].SiacoinOutput.Value) > 0
sort.Slice(utxos, func(i, j int) bool {
return utxos[i].SiacoinOutput.Value.Cmp(utxos[j].SiacoinOutput.Value) > 0
})

// prepare defrag transactions
Expand Down

0 comments on commit 22a9296

Please sign in to comment.