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

pass stopped into consume so we can halt txhashset mid download #3157

Merged

Conversation

antiochp
Copy link
Member

@antiochp antiochp commented Dec 5, 2019

We check stopped before every msg consumed to see if the the node is in the process of shutting down, so we can stop the peer read threads robustly.

This PR passes stopped into consume() so we can check it during the txhashset download in the read loop. This allows us to halt the txhashset mid download, making it possible to stop and restart the node easily if the download is from a slow peer.

Copy link
Member

@quentinlesceller quentinlesceller left a comment

Choose a reason for hiding this comment

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

👍

@antiochp
Copy link
Member Author

antiochp commented Dec 5, 2019

I'm pretty sure we used to do something similar to this but it was removed during one of the many rewrites of the p2p layer.

(Getting tired of kill -9 and then having to restart the terminal because the tui messes with the terminal formatting if it dies like this).

@antiochp antiochp added this to the 3.0.0 milestone Dec 5, 2019
@antiochp antiochp merged commit 8b8f0a0 into mimblewimble:master Dec 5, 2019
@antiochp antiochp deleted the check_stopped_txhashset_download branch December 5, 2019 12:14
@antiochp antiochp mentioned this pull request Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants