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

Update libp2p discovery #300

Merged
merged 2 commits into from
Apr 23, 2020
Merged

Update libp2p discovery #300

merged 2 commits into from
Apr 23, 2020

Conversation

aschmahmann
Copy link
Contributor

This update includes a discovery fix libp2p/go-libp2p-discovery#54 for libp2p/go-libp2p-discovery#53 which was originally reported in this repo.

Comment on lines -35 to +41
rng := rand.New(rand.NewSource(rand.Int63()))
rngSrc := rand.NewSource(rand.Int63())
minBackoff, maxBackoff := time.Second*10, time.Hour
cacheSize := 100
dialTimeout := time.Minute * 2
discoverOpts := &discoverOptions{
connFactory: func(host host.Host) (*discimpl.BackoffConnector, error) {
backoff := discimpl.NewExponentialBackoff(minBackoff, maxBackoff, discimpl.FullJitter, time.Second, 5.0, 0, rng)
backoff := discimpl.NewExponentialBackoff(minBackoff, maxBackoff, discimpl.FullJitter, time.Second, 5.0, 0, rngSrc)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: This change isn't really necessary since *rand.Rand implements rand.Source. I figured why bother wrapping it in a struct for now, but don't feel strongly either way.

@vyzo vyzo merged commit 4fc98a0 into master Apr 23, 2020
@vyzo vyzo deleted the chore/update-discovery branch April 23, 2020 11:23
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.

3 participants