From a68dec8c19e92c2a49cbd3566983aca112cff5e4 Mon Sep 17 00:00:00 2001 From: ziggie Date: Wed, 2 Jul 2025 15:19:28 +0200 Subject: [PATCH] discovery: add comments --- discovery/gossiper.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/discovery/gossiper.go b/discovery/gossiper.go index 043ab1f61..1df485756 100644 --- a/discovery/gossiper.go +++ b/discovery/gossiper.go @@ -411,6 +411,10 @@ type processedNetworkMsg struct { // cachedNetworkMsg is a wrapper around a network message that can be used with // *lru.Cache. +// +// NOTE: This struct is not thread safe which means you need to assure no +// concurrent read write access to it and all its contents which are pointers +// as well. type cachedNetworkMsg struct { msgs []*processedNetworkMsg } @@ -3134,7 +3138,9 @@ func (d *AuthenticatedGossiper) handleChanUpdate(ctx context.Context, // NOTE: We don't return anything on the error channel for this // message, as we expect that will be done when this - // ChannelUpdate is later reprocessed. + // ChannelUpdate is later reprocessed. This might never happen + // if the corresponding ChannelAnnouncement is never received + // or the LRU cache is filled up and the entry is evicted. return nil, false default: