File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed
Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change 8383 // only be used for automatically dispatched swaps if autoloop is
8484 // explicitly enabled, so we are happy to set a non-zero value here. The
8585 // amount chosen simply uses the current defaults to provide budget for
86- // a single swap. We don't have a swap amount to calculate our maximum
87- // routing fee, so we use 0.16 BTC for now.
88- defaultBudget = defaultMaximumMinerFee +
89- ppmToSat (funding .MaxBtcFundingAmount , defaultSwapFeePPM ) +
90- ppmToSat (defaultMaximumPrepay , defaultPrepayRoutingFeePPM ) +
91- ppmToSat (funding .MaxBtcFundingAmount , defaultRoutingFeePPM )
86+ // a single swap. We don't have a swap amount so we just use our max
87+ // funding amount.
88+ defaultBudget = ppmToSat (funding .MaxBtcFundingAmount , defaultFeePPM )
9289
9390 // defaultParameters contains the default parameters that we start our
9491 // liquidity manger with.
Original file line number Diff line number Diff line change @@ -622,6 +622,13 @@ func TestSweepFeeLimit(t *testing.T) {
622622 params := defaultParameters
623623 params .FeeLimit = defaultFeeCategoryLimit ()
624624
625+ // Set our budget to cover a single swap with these
626+ // parameters.
627+ params .AutoFeeBudget = defaultMaximumMinerFee +
628+ ppmToSat (7500 , defaultSwapFeePPM ) +
629+ ppmToSat (7500 , defaultPrepayRoutingFeePPM ) +
630+ ppmToSat (7500 , defaultRoutingFeePPM )
631+
625632 params .ChannelRules = map [lnwire.ShortChannelID ]* ThresholdRule {
626633 chanID1 : chanRule ,
627634 }
@@ -855,6 +862,13 @@ func TestFeeLimits(t *testing.T) {
855862 params := defaultParameters
856863 params .FeeLimit = defaultFeeCategoryLimit ()
857864
865+ // Set our budget to cover a single swap with these
866+ // parameters.
867+ params .AutoFeeBudget = defaultMaximumMinerFee +
868+ ppmToSat (7500 , defaultSwapFeePPM ) +
869+ ppmToSat (7500 , defaultPrepayRoutingFeePPM ) +
870+ ppmToSat (7500 , defaultRoutingFeePPM )
871+
858872 params .ChannelRules = map [lnwire.ShortChannelID ]* ThresholdRule {
859873 chanID1 : chanRule ,
860874 }
You can’t perform that action at this time.
0 commit comments