Skip to content

Commit

Permalink
Merge pull request ipfs#54 from libp2p/feat/add-peerinfo-provs
Browse files Browse the repository at this point in the history
Add addresses from received provider records
  • Loading branch information
whyrusleeping committed Mar 24, 2017
2 parents 55cd291 + 52e620c commit 8f3ea4e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,9 @@ func (dht *IpfsDHT) findProvidersAsyncRoutine(ctx context.Context, key *cid.Cid,

// Add unique providers from request, up to 'count'
for _, prov := range provs {
if prov.ID != dht.self {
dht.peerstore.AddAddrs(prov.ID, prov.Addrs, pstore.TempAddrTTL)
}
log.Debugf("got provider: %s", prov)
if ps.TryAdd(prov.ID) {
log.Debugf("using provider: %s", prov)
Expand Down

0 comments on commit 8f3ea4e

Please sign in to comment.