sweep: allow specifying starting fee rate for fee func

This commit is contained in:
yyforyongyu
2024-04-11 17:08:36 +08:00
parent db3aad31aa
commit b6a2984167
8 changed files with 140 additions and 20 deletions

View File

@@ -114,6 +114,10 @@ type BumpRequest struct {
// MaxFeeRate is the maximum fee rate that can be used for fee bumping.
MaxFeeRate chainfee.SatPerKWeight
// StartingFeeRate is an optional parameter that can be used to specify
// the initial fee rate to use for the fee function.
StartingFeeRate fn.Option[chainfee.SatPerKWeight]
}
// MaxFeeRateAllowed returns the maximum fee rate allowed for the given
@@ -380,6 +384,7 @@ func (t *TxPublisher) initializeFeeFunction(
// TODO(yy): return based on differet req.Strategy?
return NewLinearFeeFunction(
maxFeeRateAllowed, confTarget, t.cfg.Estimator,
req.StartingFeeRate,
)
}