Skip to content

Commit

Permalink
tapgarden: 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 minting transaction.
  • Loading branch information
gijswijs committed Nov 14, 2024
1 parent f0907b5 commit 72442f0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tapgarden/planter.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,17 @@ func (c *ChainPlanter) fundGenesisPsbt(ctx context.Context,
return nil, fmt.Errorf("unable to estimate fee: %w",
err)
}
minRelayFee, err := c.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
}

log.Infof("estimated fee rate for batch: %x, %s",
batchKey[:], feeRate.FeePerKVByte().String())
Expand Down

0 comments on commit 72442f0

Please sign in to comment.