Commit 8f3ea4e6 authored by Jeromy Johnson's avatar Jeromy Johnson Committed by GitHub

Merge pull request #54 from libp2p/feat/add-peerinfo-provs

Add addresses from received provider records
parents 55cd2914 52e620c6
...@@ -349,6 +349,9 @@ func (dht *IpfsDHT) findProvidersAsyncRoutine(ctx context.Context, key *cid.Cid, ...@@ -349,6 +349,9 @@ func (dht *IpfsDHT) findProvidersAsyncRoutine(ctx context.Context, key *cid.Cid,
// Add unique providers from request, up to 'count' // Add unique providers from request, up to 'count'
for _, prov := range provs { for _, prov := range provs {
if prov.ID != dht.self {
dht.peerstore.AddAddrs(prov.ID, prov.Addrs, pstore.TempAddrTTL)
}
log.Debugf("got provider: %s", prov) log.Debugf("got provider: %s", prov)
if ps.TryAdd(prov.ID) { if ps.TryAdd(prov.ID) {
log.Debugf("using provider: %s", prov) log.Debugf("using provider: %s", prov)
......
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