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

swarm.DialPeer and host.Connect should fail when no direct/unlimited connection is available to the peer #2714

Open
sukunrt opened this issue Feb 21, 2024 · 0 comments
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@sukunrt
Copy link
Member

sukunrt commented Feb 21, 2024

Currently there's an inconsistency between swarm.NewStream and swarm.DialPeer. swarm.NewStream returns ErrTransientConn when no unlimited connection to the peer exists. swarm.DialPeer returns the transient connection even when no network.WithUseTransient option is used.

swarm.DialPeer should wait for a direct connection when it only has a transient connection and return ErrTransientConn if it fails to get a hole punched connection, just like swarm.NewStream

host.Connect should also have the same behaviour.

This was referenced Feb 21, 2024
@sukunrt sukunrt added the kind/bug A bug in existing code (including security flaws) label Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

1 participant