htlcswitch: add error return value to NewInterceptableSwitch

Prepares for parameter validation.
This commit is contained in:
Joost Jager
2022-10-14 14:25:25 +02:00
parent 93a7cab46e
commit 74eeb95e8c
4 changed files with 33 additions and 20 deletions

View File

@@ -666,7 +666,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
if err != nil {
return nil, err
}
s.interceptableSwitch = htlcswitch.NewInterceptableSwitch(
s.interceptableSwitch, err = htlcswitch.NewInterceptableSwitch(
&htlcswitch.InterceptableSwitchConfig{
Switch: s.htlcSwitch,
CltvRejectDelta: lncfg.DefaultFinalCltvRejectDelta,
@@ -674,6 +674,9 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
Notifier: s.cc.ChainNotifier,
},
)
if err != nil {
return nil, err
}
s.witnessBeacon = newPreimageBeacon(
dbs.ChanStateDB.NewWitnessCache(),