From 2def3fc54259beb462426c9d276a3f9a6d0e4cb8 Mon Sep 17 00:00:00 2001 From: eugene Date: Tue, 6 Sep 2022 17:59:25 -0400 Subject: [PATCH 1/2] server.go: add peerChan to peerConnectedListeners in NotifyWhenOnline This fixes a bug where a caller would: - call NotifyWhenOnline and pass in a channel - the server's mutex is held and the pubStr is checked in peersByPub - the peer object is in the peersByPub map - the peer object has its quit channel closed - QuitSignal is called in the select statement, and the function returns - the caller is still waiting for the channel to be sent on forever since it was never sent on or added to the peerConnectedListeners slice. This patch fixes the above bug by adding the channel to the peerConnectedListeners slice if the QuitSignal select case is called. --- server.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server.go b/server.go index ad34055d5f..3d4a3d640e 100644 --- a/server.go +++ b/server.go @@ -3195,7 +3195,13 @@ func (s *server) NotifyWhenOnline(peerKey [33]byte, select { case <-peer.ActiveSignal(): case <-peer.QuitSignal(): - // The peer quit so we'll just return. + // The peer quit, so we'll add the channel to the slice + // and return. + s.mu.Lock() + s.peerConnectedListeners[pubStr] = append( + s.peerConnectedListeners[pubStr], peerChan, + ) + s.mu.Unlock() return } From 02f7fa91d5e698ccdc72414b3a19a6677a4891aa Mon Sep 17 00:00:00 2001 From: eugene Date: Wed, 7 Sep 2022 11:20:40 -0400 Subject: [PATCH 2/2] release-notes: update for 0.15.2 --- docs/release-notes/release-notes-0.15.2.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/release-notes/release-notes-0.15.2.md b/docs/release-notes/release-notes-0.15.2.md index 8cbc9802bc..370bae0d74 100644 --- a/docs/release-notes/release-notes-0.15.2.md +++ b/docs/release-notes/release-notes-0.15.2.md @@ -6,6 +6,12 @@ (`POST /v1/graph/routes`)](https://github.com/lightningnetwork/lnd/pull/6926) to make it possible to specify `route_hints` over REST. +## Bug Fixes + +* [A bug where LND wouldn't send a ChannelUpdate during a channel open has + been fixed.](https://github.com/lightningnetwork/lnd/pull/6892) + # Contributors (Alphabetical Order) +* Eugene Siegel * Oliver Gugger