Commit 74c3cfc1 authored by Juan Batiz-Benet's avatar Juan Batiz-Benet

addr-explosion mitigated adding

mitigated adding our own addresses where received
from peers

see #573
parent 6e8403d7
...@@ -112,7 +112,9 @@ func (bsnet *impl) FindProvidersAsync(ctx context.Context, k util.Key, max int) ...@@ -112,7 +112,9 @@ func (bsnet *impl) FindProvidersAsync(ctx context.Context, k util.Key, max int)
defer close(out) defer close(out)
providers := bsnet.routing.FindProvidersAsync(ctx, k, max) providers := bsnet.routing.FindProvidersAsync(ctx, k, max)
for info := range providers { for info := range providers {
bsnet.host.Peerstore().AddAddresses(info.ID, info.Addrs) if info.ID != bsnet.host.ID() { // dont add addrs for ourselves.
bsnet.host.Peerstore().AddAddresses(info.ID, info.Addrs)
}
select { select {
case <-ctx.Done(): case <-ctx.Done():
return return
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment