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

EnableAutoRelay should work without ContentRouting if there are StaticRelays defined #810

Merged
merged 1 commit into from
Mar 7, 2020

Conversation

aschmahmann
Copy link
Collaborator

@aschmahmann aschmahmann commented Feb 28, 2020

Given that if static relays are passed in to the AutoRelay constructor we should be able to construct an AutoRelay even when there are no ContentRouting implementations passed in.

@willscott ran into this issue when trying to construct testground integration tests of autorelay. We can hack around it by passing in a Null ContentRouter implementation, but that seems incorrect.

} else {
_ = relay.NewAutoRelay(swrm.Context(), h, discovery, router, cfg.StaticRelays)
if router == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

potentially combined with previous line into } else if router == nil {

Copy link
Contributor

@vyzo vyzo left a comment

Choose a reason for hiding this comment

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

LGTM

@Stebalien Stebalien merged commit d6d2081 into master Mar 7, 2020
@hsanjuan
Copy link
Contributor

hsanjuan commented Mar 9, 2020

Please update the (already very confusing) docs: https://godoc.org/github.com/libp2p/go-libp2p#EnableAutoRelay

@Stebalien Stebalien deleted the fix/relays-without-content-routing branch March 9, 2020 14:32
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.

5 participants