fix: coin selection mode
This commit is contained in:
parent
eedd0ee6a3
commit
74328bfeb5
1 changed files with 4 additions and 4 deletions
|
|
@ -108,11 +108,11 @@ async function utxoList(path) {
|
||||||
this.utxos.forEach(u => (u.selected = true))
|
this.utxos.forEach(u => (u.selected = true))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
console.log('### applyUtxoSelectionMode')
|
||||||
const payedAmount = this['payed-amount']
|
|
||||||
this.utxos.forEach(u => (u.selected = false))
|
this.utxos.forEach(u => (u.selected = false))
|
||||||
const isManual = mode === 'Manual'
|
const isManual = mode === 'Manual'
|
||||||
if (isManual || !payedAmount) return
|
if (isManual || !this.payedAmount) return
|
||||||
|
|
||||||
const isSmallerFirst = mode === 'Smaller Inputs First'
|
const isSmallerFirst = mode === 'Smaller Inputs First'
|
||||||
const isLargerFirst = mode === 'Larger Inputs First'
|
const isLargerFirst = mode === 'Larger Inputs First'
|
||||||
|
|
@ -128,7 +128,7 @@ async function utxoList(path) {
|
||||||
selectedUtxos = _.shuffle(selectedUtxos)
|
selectedUtxos = _.shuffle(selectedUtxos)
|
||||||
}
|
}
|
||||||
selectedUtxos.reduce((total, utxo) => {
|
selectedUtxos.reduce((total, utxo) => {
|
||||||
utxo.selected = total < payedAmount
|
utxo.selected = total < this.payedAmount
|
||||||
total += utxo.amount
|
total += utxo.amount
|
||||||
return total
|
return total
|
||||||
}, 0)
|
}, 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue