htlcswitch: add dedicated block subscription to interceptable switch

Preparation for making the interceptable switch aware of expiring htlcs.
This commit is contained in:
Joost Jager committed 2022-10-18 18:04:33 +02:00
1 parent 4a3e90f4d0
commit a6df9567ba
4 files changed
+92 -5

No files matched your search

+8
View File
@@ -359,6 +359,13 @@ func createTestPeer(t *testing.T, notifier chainntnfs.ChainNotifier,
ChainNet: wire.SimNet,
}
interceptableSwitchNotifier := &mock.ChainNotifier{
EpochChan: make(chan *chainntnfs.BlockEpoch, 1),
}
interceptableSwitchNotifier.EpochChan <- &chainntnfs.BlockEpoch{
Height: 1,
}
cfg := &Config{
Addr: cfgAddr,
PubKeyBytes: pubKey,
@@ -369,6 +376,7 @@ func createTestPeer(t *testing.T, notifier chainntnfs.ChainNotifier,
InterceptSwitch: htlcswitch.NewInterceptableSwitch(
&htlcswitch.InterceptableSwitchConfig{
CltvRejectDelta: testCltvRejectDelta,
Notifier: interceptableSwitchNotifier,
},
),
ChannelDB: dbAlice.ChannelStateDB(),