htlcswitch: auto-fail held htlcs

Make the interceptable switch aware of htlc expiry and fail back htlcs in-time
to prevent the counterparty from force-closing the channel.
This commit is contained in:
Joost Jager
2022-08-15 17:28:19 +02:00
parent 74eeb95e8c
commit a0a50fa844
13 changed files with 429 additions and 212 deletions

View File

@@ -670,6 +670,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
&htlcswitch.InterceptableSwitchConfig{
Switch: s.htlcSwitch,
CltvRejectDelta: lncfg.DefaultFinalCltvRejectDelta,
CltvInterceptDelta: lncfg.DefaultCltvInterceptDelta,
RequireInterceptor: s.cfg.RequireInterceptor,
Notifier: s.cc.ChainNotifier,
},