Skip to content

Commit 8f3ea4e

Browse files
Merge pull request ipfs#54 from libp2p/feat/add-peerinfo-provs
Add addresses from received provider records
2 parents 55cd291 + 52e620c commit 8f3ea4e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

routing.go

+3
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,9 @@ func (dht *IpfsDHT) findProvidersAsyncRoutine(ctx context.Context, key *cid.Cid,
349349

350350
// Add unique providers from request, up to 'count'
351351
for _, prov := range provs {
352+
if prov.ID != dht.self {
353+
dht.peerstore.AddAddrs(prov.ID, prov.Addrs, pstore.TempAddrTTL)
354+
}
352355
log.Debugf("got provider: %s", prov)
353356
if ps.TryAdd(prov.ID) {
354357
log.Debugf("using provider: %s", prov)

0 commit comments

Comments
 (0)