mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
Estimate fee correctly for --send-all
This commit is contained in:
parent
2d25c3d7a3
commit
decbcd8233
@ -196,9 +196,12 @@ func (s *server) selectUTXOsWithPreselected(preSelectedUTXOs []*walletUTXO, allo
|
||||
})
|
||||
|
||||
totalValue += utxo.UTXOEntry.Amount()
|
||||
|
||||
// We're overestimating a bit by assuming that any transaction will have a change output
|
||||
fee, err = s.estimateFee(selectedUTXOs, feeRate, maxFee, spendAmount)
|
||||
estimatedRecipientValue := spendAmount
|
||||
if isSendAll {
|
||||
estimatedRecipientValue = totalValue
|
||||
}
|
||||
|
||||
fee, err = s.estimateFee(selectedUTXOs, feeRate, maxFee, estimatedRecipientValue)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user