peer: skip retrying when reenableTimeout is greater than 1 min

This commit makes retrying enabling channels conditional. We now would
only retry sending the enable request when the `ChanActiveTimeout` is no
greater than 1 min.
This commit is contained in:
yyforyongyu committed 2023-01-18 03:46:17 +08:00
1 parent 2f9ba1594c
commit a012a5e2ff
2 files changed
+65 -21

No files matched your search

+1 -4
View File
@@ -410,11 +410,8 @@ func createTestPeer(t *testing.T, notifier chainntnfs.ChainNotifier,
chanID := lnwire.NewChanIDFromOutPoint(channelAlice.ChannelPoint())
alicePeer.activeChannels[chanID] = channelAlice
sub, err := cfg.ChannelNotifier.SubscribeChannelEvents()
require.NoError(t, err)
alicePeer.wg.Add(1)
go alicePeer.channelManager(sub)
go alicePeer.channelManager()
return alicePeer, channelBob, nil
}