Skip to content

Commit

Permalink
tapfreighter: bump feerate to min relay fee
Browse files Browse the repository at this point in the history
If the fee estimation returns a fee rate lower than the min relay fee,
we should use the min relay fee instead. This commit implements this
behavior for the tapfreighter.
  • Loading branch information
gijswijs committed Nov 14, 2024
1 parent 72442f0 commit a843f4f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tapfreighter/chain_porter.go
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,17 @@ func (p *ChainPorter) stateStep(currentPkg sendPackage) (*sendPackage, error) {
return nil, fmt.Errorf("unable to estimate "+
"fee: %w", err)
}
minRelayFee, err := p.cfg.Wallet.MinRelayFee(ctx)
if err != nil {
return nil, fmt.Errorf("unable to obtain "+
"minimum relay fee: %w", err)
}

// If the fee rate is below the minimum relay fee, we'll
// bump it up.
if feeRate < minRelayFee {
feeRate = minRelayFee
}
}

readableFeeRate := feeRate.FeePerKVByte().String()
Expand Down

0 comments on commit a843f4f

Please sign in to comment.