Skip to content

Commit

Permalink
basichost: ensure no duplicates in Addrs output
Browse files Browse the repository at this point in the history
  • Loading branch information
sukunrt committed Sep 26, 2024
1 parent 9038a72 commit b32e7aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion p2p/host/basic/basic_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ func (h *BasicHost) ConnManager() connmgr.ConnManager {
func (h *BasicHost) Addrs() []ma.Multiaddr {
// We don't need to append certhashes here, the user provided addrsFactory was
// wrapped with addCertHashes in the constructor.
addrs := h.AddrsFactory(h.AllAddrs())
addrs := ma.Unique(h.AddrsFactory(h.AllAddrs()))
// Make a copy. Consumers can modify the slice elements
res := make([]ma.Multiaddr, len(addrs))
copy(res, addrs)
Expand Down

0 comments on commit b32e7aa

Please sign in to comment.