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

Simplify peer connection handling #2801

Merged
merged 7 commits into from
May 3, 2019

Conversation

antiochp
Copy link
Member

@antiochp antiochp commented May 3, 2019

The peer connection used to be wrapped in an option.
This complicated the initialization of a peer (with active connection) due to the period between creating the peer and assigning the connection to it.
The workaround was the connection! macro to handle the case where the connection was None.

This PR simplifies this. Peer::accept() and Peer::connect() now return a peer with active connection already assigned.

We have less special cases to handle like this.

p2p/src/peer.rs Outdated Show resolved Hide resolved
p2p/src/peer.rs Outdated Show resolved Hide resolved
p2p/src/peer.rs Outdated Show resolved Hide resolved
p2p/src/peer.rs Outdated Show resolved Hide resolved
p2p/src/peer.rs Outdated Show resolved Hide resolved
p2p/src/peer.rs Outdated Show resolved Hide resolved
@antiochp antiochp changed the title Simply peer connection handling Simplify peer connection handling May 3, 2019
@antiochp antiochp force-pushed the peer_connection_simplify branch from 61ea67d to 2ea4b91 Compare May 3, 2019 12:38
@antiochp antiochp force-pushed the peer_connection_simplify branch from 2ea4b91 to 81b5ddd Compare May 3, 2019 14:41
@antiochp antiochp merged commit 4ef4212 into mimblewimble:master May 3, 2019
@antiochp antiochp deleted the peer_connection_simplify branch May 3, 2019 14:56
@antiochp antiochp added this to the 1.1.0 milestone Jun 5, 2019
@antiochp antiochp added the release notes To be included in release notes (of relevant milestone). label Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement release notes To be included in release notes (of relevant milestone).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants