mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-08 20:03:10 +01:00
sweep: increase delta fee rate precision in fee function
This commit adds a private type `mSatPerKWeight` that expresses a given fee rate in millisatoshi per kw. This is needed to increase the precision of the fee function. When sweeping anchor inputs, if using a deadline delta of over 1000, it's likely the delta will be 0 sat/kw due to precision.
This commit is contained in:
@@ -54,8 +54,8 @@ func TestLinearFeeFunctionNew(t *testing.T) {
|
||||
//
|
||||
// Mock the fee estimator to return the fee rate.
|
||||
estimator.On("EstimateFeePerKW", confTarget).Return(
|
||||
// The starting fee rate is 1 sat/kw less than the max fee rate.
|
||||
maxFeeRate-1, nil).Once()
|
||||
// The starting fee rate is the max fee rate.
|
||||
maxFeeRate, nil).Once()
|
||||
estimator.On("RelayFeePerKW").Return(estimatedFeeRate).Once()
|
||||
|
||||
f, err = NewLinearFeeFunction(maxFeeRate, confTarget, estimator)
|
||||
@@ -96,7 +96,7 @@ func TestLinearFeeFunctionFeeRateAtPosition(t *testing.T) {
|
||||
startingFeeRate: 1000,
|
||||
endingFeeRate: 3000,
|
||||
position: 0,
|
||||
deltaFeeRate: 1000,
|
||||
deltaFeeRate: 1_000_000,
|
||||
width: 3,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user