mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-12 22:22:36 +02:00
htlcswitch+lnwallet: calculate fee exposure as commit fees + dust
This commit expands the definition of the dust limit to take into account commitment fees as well as dust HTLCs. The dust limit is now known as a fee exposure threshold. Dust HTLCs are fees anyways so it makes sense to account for commitment fees as well. The link has been modified slightly to calculate dust. In the future, the switch dust calculations can be removed.
This commit is contained in:
@ -4471,10 +4471,20 @@ func TestChannelLinkUpdateCommitFee(t *testing.T) {
|
||||
|
||||
// Triggering the link to update the fee of the channel with a fee rate
|
||||
// that exceeds its maximum fee allocation should result in a fee rate
|
||||
// corresponding to the maximum fee allocation.
|
||||
// corresponding to the maximum fee allocation. Increase the dust
|
||||
// threshold so that we don't trigger that logic.
|
||||
highFeeExposure := lnwire.NewMSatFromSatoshis(
|
||||
2 * btcutil.SatoshiPerBitcoin,
|
||||
)
|
||||
const maxFeeRate chainfee.SatPerKWeight = 207180182
|
||||
n.aliceChannelLink.cfg.MaxFeeExposure = highFeeExposure
|
||||
n.firstBobChannelLink.cfg.MaxFeeExposure = highFeeExposure
|
||||
triggerFeeUpdate(maxFeeRate+1, minRelayFee, maxFeeRate, true)
|
||||
|
||||
// Decrease the max fee exposure back to normal.
|
||||
n.aliceChannelLink.cfg.MaxFeeExposure = DefaultMaxFeeExposure
|
||||
n.firstBobChannelLink.cfg.MaxFeeExposure = DefaultMaxFeeExposure
|
||||
|
||||
// Triggering the link to update the fee of the channel with a fee rate
|
||||
// that is below the current min relay fee rate should result in a fee
|
||||
// rate corresponding to the minimum relay fee.
|
||||
|
Reference in New Issue
Block a user