fix: coin selection mode

This commit is contained in:
Vlad Stan 2022-07-26 14:11:42 +03:00
parent eedd0ee6a3
commit 74328bfeb5

View file

@ -108,11 +108,11 @@ async function utxoList(path) {
this.utxos.forEach(u => (u.selected = true))
return
}
const payedAmount = this['payed-amount']
console.log('### applyUtxoSelectionMode')
this.utxos.forEach(u => (u.selected = false))
const isManual = mode === 'Manual'
if (isManual || !payedAmount) return
if (isManual || !this.payedAmount) return
const isSmallerFirst = mode === 'Smaller Inputs First'
const isLargerFirst = mode === 'Larger Inputs First'
@ -128,7 +128,7 @@ async function utxoList(path) {
selectedUtxos = _.shuffle(selectedUtxos)
}
selectedUtxos.reduce((total, utxo) => {
utxo.selected = total < payedAmount
utxo.selected = total < this.payedAmount
total += utxo.amount
return total
}, 0)