Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/release-notes/release-notes-0.20.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -62,4 +66,5 @@

# Contributors (Alphabetical Order)

* bitromortac
* Ziggie
12 changes: 12 additions & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down