sweep: add new error ErrZeroFeeRateDelta

This commit is contained in:
yyforyongyu committed 2024-12-20 17:53:59 +08:00
1 parent 6c2e8b9a00
commit 5f64280df4
1 file changed
+4 -1
+4 -1
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.