Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: yield only final peers from dht getClosestPeers #1380

Merged
merged 2 commits into from Sep 23, 2022

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Sep 14, 2022

PEER_RESPONSE is an intermediate event, we should only yield from FINAL_PEER events as we'll only get K of those.

n.b. this will make the libp2p.peerRouting.getClosestPeers call take longer to start yielding results if they are only findable by the DHT but they'll be more accurate.

If you want status events, call the lower level libp2p.dht.getClosestPeers method instead.

`PEER_RESPONSE` is an intermediate event, we should only yield from `FINAL_PEER` events as we'll only get `K` of those.
@achingbrain achingbrain changed the title fix: yield final peers from dht getClosestPeers fix: yield only final peers from dht getClosestPeers Sep 14, 2022
@mpetrunic mpetrunic merged commit 3f57eda into master Sep 23, 2022
@mpetrunic mpetrunic deleted the fix/yield-final-peers-from-get-closest-peers branch September 23, 2022 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants