Closed Stebalien closed 6 years ago
I'm not sure if I was clear in my explanation. I meant that for the peers returned from GetClosestPeers len(p.Addrs) == 0
. I don't think this causes any issues but if you'd like to make the code more consistent I'd be happy to submit a fix.
I see. Yeah, it looks like we're filtering that info in some places but not others. I wonder if we should modify the PeerInfos
function in the peerstore to omit peers about which we have no info.
This is what I was getting at: https://github.com/libp2p/go-libp2p-kad-dht/pull/118
I think we can close this as the PR has been merged
Good point.
@Stebalien
Same is true for FindProviders
. Is that by design?
going by this comment
// ProviderAddrTTL is the TTL of an address we've received from a provider.
// This is also a temporary address, but lasts longer. After this expires,
// the records we return will require an extra lookup.
ProviderAddrTTL = time.Minute * 10
Yes. After that time period elapses, the requester will have to go back to the DHT a second time to find new addresses for that provider.
Once we finish moving the peerstore to disk and improve the dialer a bit, we could consider keeping these records longer.
We should be judiciously stripping these out.
See https://github.com/libp2p/go-libp2p-kad-dht/issues/88#issuecomment-365496992