Skip to content

bugfix: truncate header sync percentage#935

Open
arejula27 wants to merge 1 commit into
bitcoin-core:masterfrom
arejula27:gui-ibd-fix-header-sync-percentage
Open

bugfix: truncate header sync percentage#935
arejula27 wants to merge 1 commit into
bitcoin-core:masterfrom
arejula27:gui-ibd-fix-header-sync-percentage

Conversation

@arejula27

Copy link
Copy Markdown

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, but bestHeaderDate becomes stale over time.

After ~4 hours (HEADER_HEIGHT_DELTA_SYNC * nPowTargetSpacing), the time-based heuristic in modaloverlay.cpp considers headers as "not synced" and falls into the else branch, 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 .

@DrahtBot

DrahtBot commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

Comment thread src/qt/modaloverlay.cpp Outdated
luke-jr added a commit to bitcoinknots/bitcoin that referenced this pull request Apr 13, 2026
…e stale

Github-Pull: bitcoin-core/gui#935
Rewritten-From: 13b1c9dc4cf5d3e297ee5487dba5f587af8583d3 (plus logged percentages)
@Sjors

Sjors commented May 8, 2026

Copy link
Copy Markdown
Member

@hebasto can you add a bug label to this PR and other bug fixes? That makes it easier to track them (e.g. with RSS feed).

@sedited sedited added the Bug Something isn't working label May 11, 2026
@arejula27

Copy link
Copy Markdown
Author

@polespinasa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GUI misses some header updates when in IBD

5 participants