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

fix: for TUI status try to acquire read lock on pmmr_header but if no… #3119

Merged
merged 2 commits into from
Nov 15, 2019

Conversation

JosephGoulden
Copy link
Contributor

TUI status is currently broken when syncing the chain. It stops responding and does not show the percentage validation status of the txhashset. This is because during validation there is long lived write lock on pmmr_header. So when we try to get a read lock to update the status it blocks.

This fix adds a try_header_head() function which might return a Tip or not if the lock is not available right away. For TUI status this is okay as we can just update based on the available information and do not need to block.

…t available just leave the header stats alone
@hashmap hashmap merged commit 29b8718 into mimblewimble:master Nov 15, 2019
@JosephGoulden JosephGoulden deleted the fix-header-read-lock branch November 15, 2019 08:57
Copy link
Member

@antiochp antiochp left a comment

Choose a reason for hiding this comment

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

👍 Nice.

@antiochp
Copy link
Member

Some day we'll actually have useful read locks around some of this that actually allow validation to happen without blocking.

@antiochp antiochp added this to the 3.0.0 milestone Dec 11, 2019
@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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants