Skip to content

Commit 997f33e

Browse files
authored
fix addrsSoFar comparison (#1046)
1 parent bdc3815 commit 997f33e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fullrt/dht.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,7 @@ func (dht *FullRT) FindPeer(ctx context.Context, id peer.ID) (pi peer.AddrInfo,
14421442
wg.Add(1)
14431443
go func() {
14441444
defer wg.Done()
1445-
addrsSoFar := make(map[multiaddr.Multiaddr]struct{})
1445+
addrsSoFar := make(map[string]struct{})
14461446
for {
14471447
select {
14481448
case ai, ok := <-addrsCh:
@@ -1451,10 +1451,10 @@ func (dht *FullRT) FindPeer(ctx context.Context, id peer.ID) (pi peer.AddrInfo,
14511451
}
14521452

14531453
for _, a := range ai.Addrs {
1454-
_, found := addrsSoFar[a]
1454+
_, found := addrsSoFar[string(a.Bytes())]
14551455
if !found {
14561456
newAddrs = append(newAddrs, a)
1457-
addrsSoFar[a] = struct{}{}
1457+
addrsSoFar[string(a.Bytes())] = struct{}{}
14581458
}
14591459
}
14601460
case <-ctx.Done():

0 commit comments

Comments
 (0)