1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-10 09:52:20 +08:00

addr-explosion mitigated adding

mitigated adding our own addresses where received
from peers

see #573
This commit is contained in:
Juan Batiz-Benet
2015-01-16 02:13:00 -08:00
parent f78d4141a1
commit c057cea649
4 changed files with 14 additions and 5 deletions

View File

@ -254,6 +254,11 @@ func (r *dhtQueryRunner) queryPeer(cg ctxgroup.ContextGroup, p peer.ID) {
} else if len(res.closerPeers) > 0 {
log.Debugf("PEERS CLOSER -- worker for: %v (%d closer peers)", p, len(res.closerPeers))
for _, next := range res.closerPeers {
if next.ID == r.query.dht.self { // dont add self.
log.Debugf("PEERS CLOSER -- worker for: %v found self", p)
continue
}
// add their addresses to the dialer's peerstore
r.query.dht.peerstore.AddPeerInfo(next)
r.addPeerToQuery(cg.Context(), next.ID)