Skip to content

Commit 52e620c

Browse files
committed
Add addresses from received provider records
Thanks @mildred for catching this and providing a patch.
1 parent 55cd291 commit 52e620c

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)