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

Lock the connection while we are initialising it #69

Merged
merged 1 commit into from
Aug 17, 2018

Conversation

metalicjames
Copy link
Member

@metalicjames metalicjames commented Aug 17, 2018

If a peer with a very small ping connected to ckd then the peer could become disconnected in another thread and the connection deleted before its initial info was committed to the database. That resulted in a segmentation fault in some cases where the connection was deleted in another thread and then subsequently used in the initialisation thread. This PR locks the connection right after its creation and only releases it once the peer is fully set up. The PR also removes an unnecessary sleep call.

Fixes #57

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.

1 participant