From 997f33e7bf9f2cc2d6593c079642b702b36138e2 Mon Sep 17 00:00:00 2001 From: Marco Munizaga Date: Thu, 20 Feb 2025 21:38:16 -0800 Subject: [PATCH] fix addrsSoFar comparison (#1046) --- fullrt/dht.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fullrt/dht.go b/fullrt/dht.go index 442d5c57..6d6c36bf 100644 --- a/fullrt/dht.go +++ b/fullrt/dht.go @@ -1442,7 +1442,7 @@ func (dht *FullRT) FindPeer(ctx context.Context, id peer.ID) (pi peer.AddrInfo, wg.Add(1) go func() { defer wg.Done() - addrsSoFar := make(map[multiaddr.Multiaddr]struct{}) + addrsSoFar := make(map[string]struct{}) for { select { case ai, ok := <-addrsCh: @@ -1451,10 +1451,10 @@ func (dht *FullRT) FindPeer(ctx context.Context, id peer.ID) (pi peer.AddrInfo, } for _, a := range ai.Addrs { - _, found := addrsSoFar[a] + _, found := addrsSoFar[string(a.Bytes())] if !found { newAddrs = append(newAddrs, a) - addrsSoFar[a] = struct{}{} + addrsSoFar[string(a.Bytes())] = struct{}{} } } case <-ctx.Done():