sweep: add new error ErrZeroFeeRateDelta

This commit is contained in:
yyforyongyu 2024-10-25 15:27:26 +08:00
parent 6c2e8b9a00
commit 5f64280df4
No known key found for this signature in database
GPG Key ID: 9BCD95C4FF296868

View File

@ -14,6 +14,9 @@ var (
// ErrMaxPosition is returned when trying to increase the position of
// the fee function while it's already at its max.
ErrMaxPosition = errors.New("position already at max")
// ErrZeroFeeRateDelta is returned when the fee rate delta is zero.
ErrZeroFeeRateDelta = errors.New("fee rate delta is zero")
)
// mSatPerKWeight represents a fee rate in msat/kw.
@ -169,7 +172,7 @@ func NewLinearFeeFunction(maxFeeRate chainfee.SatPerKWeight,
"endingFeeRate=%v, width=%v, delta=%v", start, end,
l.width, l.deltaFeeRate)
return nil, fmt.Errorf("fee rate delta is zero")
return nil, ErrZeroFeeRateDelta
}
// Attach the calculated values to the fee function.