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:
Eugene Siegel
2024-06-03 12:43:33 -04:00
parent b7c59b36a7
commit d6001d033b
11 changed files with 456 additions and 88 deletions

View File

@@ -381,6 +381,10 @@ type Config struct {
// invalid.
DisallowRouteBlinding bool
// MaxFeeExposure limits the number of outstanding fees in a channel.
// This value will be passed to created links.
MaxFeeExposure lnwire.MilliSatoshi
// Quit is the server's quit channel. If this is closed, we halt operation.
Quit chan struct{}
}
@@ -1194,6 +1198,7 @@ func (p *Brontide) addLink(chanPoint *wire.OutPoint,
GetAliases: p.cfg.GetAliases,
PreviouslySentShutdown: shutdownMsg,
DisallowRouteBlinding: p.cfg.DisallowRouteBlinding,
MaxFeeExposure: p.cfg.MaxFeeExposure,
}
// Before adding our new link, purge the switch of any pending or live