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

Small networking fixes #72

Merged
merged 4 commits into from
Nov 3, 2016
Merged

Small networking fixes #72

merged 4 commits into from
Nov 3, 2016

Conversation

vyzo
Copy link
Contributor

@vyzo vyzo commented Nov 2, 2016

Changes in mc.NewHost:

  • client owns the context used by the swarm network object
  • allow nil address for delayed binding.

Change in mcnode/proto

  • Adds a delay in the offline->online->public transition when NATConfig = auto, so that port mapping can complete before the first directory registration attempt.

@vyzo vyzo changed the title A small networking fix: client owns the context used by the swarm network object A small networking fix Nov 2, 2016
pstore := p2p_pstore.NewPeerstore()
pstore.AddPrivKey(id.ID, id.PrivKey)
pstore.AddPubKey(id.ID, id.PrivKey.GetPublic())

var addrs []multiaddr.Multiaddr
if laddr != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

do we ever expect laddr to be nil? wouldn't this be a failure condition?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, that was added as an option to facilitate delayed address binding.
The experiment didn't pan out, but I kept the code in the mc.NewHost.
I can remove it if you find it offensive :)

@vyzo vyzo changed the title A small networking fix Small networking fixes Nov 2, 2016
@vyzo vyzo merged commit 8527b48 into master Nov 3, 2016
@vyzo vyzo deleted the vyzo-net-fixes branch November 3, 2016 09:42
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