bugfix: truncate header sync percentage#935
Open
arejula27 wants to merge 1 commit intobitcoin-core:masterfrom
Open
bugfix: truncate header sync percentage#935arejula27 wants to merge 1 commit intobitcoin-core:masterfrom
arejula27 wants to merge 1 commit intobitcoin-core:masterfrom
Conversation
Contributor
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process. LLM Linter (✨ experimental)Possible places where named args for integral literals may be used (e.g.
2026-03-28 12:54:29 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
During IBD, if
LoadingBlocks()is true (e.g. during a chainstate rebuild after a crash), the node rejects incoming headers from peers. The GUI has headers loaded from the block index on disk, butbestHeaderDatebecomes stale over time.After ~4 hours (
HEADER_HEIGHT_DELTA_SYNC * nPowTargetSpacing), the time-based heuristic inmodaloverlay.cppconsiders headers as "not synced" and falls into theelsebranch, displaying "Unknown" for both blocks remaining and estimated time. Meanwhile,UpdateHeaderSyncLabel()computes a percentage that rounds up to 100.0%, creating a contradictory display:"Unknown. Syncing Headers (942188, 100.0%)". Please read issue #65 for more context.This patch truncates the percentage to one decimal place instead of rounding, so it only shows 100.0% when headers are truly up to date. The same fix is applied to
UpdateHeaderPresyncLabel()for consistency.Fixes #65 .