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

Replacing UsefulPeer() with UsefulNewPeer() #120

Merged
merged 3 commits into from
Jun 14, 2023
Merged

Conversation

guillaumemichel
Copy link
Contributor

A peer should be considered as useful for the routing table if it isn't already in the routing table.

Renamed UsefulPeer() to UsefulNewPeer(), and added a check to verify if the peer is already in the routing table.

See libp2p/go-libp2p-kad-dht@d373974#r117905977

guillaumemichel referenced this pull request in libp2p/go-libp2p-kad-dht Jun 14, 2023
* added check to avoid adding unresponsive dht peers to the dht routing table

* removed lock in adding peers to the rt

* made variable names more meaningful

* fixed network loop and corrected tests

* added UsefulPeer() references from current PR

* go mod tidy

* added delay in TestRefreshBelowMinRTThreshold

* addressed review

* go mod tidy

* addressed Jorropo review

* added comments

* removed state of peers probed recently

* fix conflicts merge

* updated deps

* added optimizations documentation

* Update dht.go

* updated md files

---------

Co-authored-by: Jorropo <jorropo.pgm@gmail.com>
(cherry picked from commit 8c9fdff)
Copy link
Contributor

@Jorropo Jorropo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thx, feel free to add a patch bump in version.json in a new chore: release vx.y.Z commit and merge this.

@guillaumemichel guillaumemichel merged commit 822d285 into master Jun 14, 2023
@guillaumemichel guillaumemichel deleted the fix/useful-peers branch June 14, 2023 12:03
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.

2 participants