From 031903f275f307df8e3281564653eae3042e3439 Mon Sep 17 00:00:00 2001 From: bitromortac Date: Wed, 26 Nov 2025 16:54:56 +0100 Subject: [PATCH 1/2] server: ensure unique addresses for node ann Modifiers of the node announcement may add duplicate addresses, which we remove here after the modifications were applied. This also ensures that any previously added duplicate addresses are removed as well. --- server.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server.go b/server.go index 3c011f8b0..1c2db3d91 100644 --- a/server.go +++ b/server.go @@ -3399,6 +3399,18 @@ func (s *server) genNodeAnnouncement(features *lnwire.RawFeatureVector, modifier(&newNodeAnn) } + // The modifiers may have added duplicate addresses, so we need to + // de-duplicate them here. + uniqueAddrs := map[string]struct{}{} + dedupedAddrs := make([]net.Addr, 0) + for _, addr := range newNodeAnn.Addresses { + if _, ok := uniqueAddrs[addr.String()]; !ok { + uniqueAddrs[addr.String()] = struct{}{} + dedupedAddrs = append(dedupedAddrs, addr) + } + } + newNodeAnn.Addresses = dedupedAddrs + // Sign a new update after applying all of the passed modifiers. err := netann.SignNodeAnnouncement( s.nodeSigner, s.identityKeyLoc, &newNodeAnn, From b513efc5c11d74775a0c4546ae538b1f31d1ad9f Mon Sep 17 00:00:00 2001 From: bitromortac Date: Wed, 26 Nov 2025 16:55:10 +0100 Subject: [PATCH 2/2] docs: add release-notes for lnd v0.20.1 --- docs/release-notes/release-notes-0.20.1.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/release-notes-0.20.1.md b/docs/release-notes/release-notes-0.20.1.md index 7dbcd31ea..59370eaae 100644 --- a/docs/release-notes/release-notes-0.20.1.md +++ b/docs/release-notes/release-notes-0.20.1.md @@ -27,7 +27,11 @@ * [Fix a case where resolving the to_local/to_remote output](https://github.com/lightningnetwork/lnd/pull/10387) might take too long. - + +* Fix a bug where [repeated network + addresses](https://github.com/lightningnetwork/lnd/pull/10341) were added to + the node announcement and `getinfo` output. + # New Features ## Functional Enhancements @@ -62,4 +66,5 @@ # Contributors (Alphabetical Order) +* bitromortac * Ziggie