fix: coin selection mode
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user