mirror of
https://github.com/ipfs/kubo.git
synced 2025-09-10 14:34:24 +08:00
addr-explosion mitigated adding
mitigated adding our own addresses where received from peers see #573
This commit is contained in:
@ -223,8 +223,10 @@ func (dht *IpfsDHT) closerPeersSingle(ctx context.Context, key u.Key, p peer.ID)
|
||||
var out []peer.ID
|
||||
for _, pbp := range pmes.GetCloserPeers() {
|
||||
pid := peer.ID(pbp.GetId())
|
||||
dht.peerstore.AddAddresses(pid, pbp.Addresses())
|
||||
out = append(out, pid)
|
||||
if pid != dht.self { // dont add self
|
||||
dht.peerstore.AddAddresses(pid, pbp.Addresses())
|
||||
out = append(out, pid)
|
||||
}
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user