diff --git a/htlcswitch/link.go b/htlcswitch/link.go index 4dbfa5223..f67d4b4af 100644 --- a/htlcswitch/link.go +++ b/htlcswitch/link.go @@ -256,6 +256,10 @@ type ChannelLinkConfig struct { // ChannelNotifier when a channel link become inactive. NotifyInactiveLinkEvent func(wire.OutPoint) + // NotifyChannelUpdate allows the link to tell the ChannelNotifier when + // a channel's state has been updated. + NotifyChannelUpdate func(*channeldb.OpenChannel) + // HtlcNotifier is an instance of a htlcNotifier which we will pipe htlc // events through. HtlcNotifier htlcNotifier diff --git a/htlcswitch/link_test.go b/htlcswitch/link_test.go index e4e63d982..29b4f902d 100644 --- a/htlcswitch/link_test.go +++ b/htlcswitch/link_test.go @@ -2241,6 +2241,7 @@ func newSingleLinkTestHarness(t *testing.T, chanAmt, MaxFeeAllocation: DefaultMaxLinkFeeAllocation, NotifyActiveLink: func(wire.OutPoint) {}, NotifyActiveChannel: func(wire.OutPoint) {}, + NotifyChannelUpdate: func(*channeldb.OpenChannel) {}, NotifyInactiveChannel: func(wire.OutPoint) {}, NotifyInactiveLinkEvent: func(wire.OutPoint) {}, HtlcNotifier: aliceSwitch.cfg.HtlcNotifier, @@ -4931,6 +4932,7 @@ func (h *persistentLinkHarness) restartLink( NotifyActiveChannel: func(wire.OutPoint) {}, NotifyInactiveChannel: func(wire.OutPoint) {}, NotifyInactiveLinkEvent: func(wire.OutPoint) {}, + NotifyChannelUpdate: func(*channeldb.OpenChannel) {}, HtlcNotifier: h.hSwitch.cfg.HtlcNotifier, SyncStates: syncStates, GetAliases: getAliases, diff --git a/htlcswitch/test_utils.go b/htlcswitch/test_utils.go index b74dbd0bb..2e0842509 100644 --- a/htlcswitch/test_utils.go +++ b/htlcswitch/test_utils.go @@ -1175,6 +1175,7 @@ func (h *hopNetwork) createChannelLink(server, peer *mockServer, NotifyActiveChannel: func(wire.OutPoint) {}, NotifyInactiveChannel: func(wire.OutPoint) {}, NotifyInactiveLinkEvent: func(wire.OutPoint) {}, + NotifyChannelUpdate: func(*channeldb.OpenChannel) {}, HtlcNotifier: server.htlcSwitch.cfg.HtlcNotifier, GetAliases: getAliases, ShouldFwdExpAccountability: func() bool { return true }, diff --git a/peer/brontide.go b/peer/brontide.go index 72ee88775..d92f9c459 100644 --- a/peer/brontide.go +++ b/peer/brontide.go @@ -1480,6 +1480,7 @@ func (p *Brontide) addLink(chanPoint *wire.OutPoint, NotifyActiveChannel: p.cfg.ChannelNotifier.NotifyActiveChannelEvent, NotifyInactiveChannel: p.cfg.ChannelNotifier.NotifyInactiveChannelEvent, NotifyInactiveLinkEvent: p.cfg.ChannelNotifier.NotifyInactiveLinkEvent, + NotifyChannelUpdate: p.cfg.ChannelNotifier.NotifyChannelUpdateEvent, HtlcNotifier: p.cfg.HtlcNotifier, GetAliases: p.cfg.GetAliases, PreviouslySentShutdown: shutdownMsg,