chanfunding: fee estimation based on change output in CoinSelect
Add a dust-limit to `CoinSelect` and let the fee estimation consider if a change output is needed or not, assuring that if the change is below the dust-limit it will go towards the fee instead.
This commit is contained in:
3 files changed
+72
-33
No files matched your search
@@ -289,9 +289,10 @@ func (w *WalletAssembler) ProvisionChannel(r *Request) (Intent, error) {
|
||||
// Otherwise do a normal coin selection where we target a given
|
||||
// funding amount.
|
||||
default:
|
||||
dustLimit := w.cfg.DustLimit
|
||||
localContributionAmt = r.LocalAmt
|
||||
selectedCoins, changeAmt, err = CoinSelect(
|
||||
r.FeeRate, r.LocalAmt, coins,
|
||||
r.FeeRate, r.LocalAmt, dustLimit, coins,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in new issue
Block a user