bugfix: truncate header sync percentage #935

pull arejula27 wants to merge 1 commits into bitcoin-core:master from arejula27:gui-ibd-fix-header-sync-percentage changing 1 files +10 −2
  1. arejula27 commented at 12:54 pm on March 28, 2026: none

    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 .

  2. gui: truncate header sync percentage to avoid showing 100% when headers are stale 13b1c9dc4c
  3. DrahtBot commented at 12:54 pm on March 28, 2026: 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.

    LLM Linter (✨ experimental)

    Possible places where named args for integral literals may be used (e.g. func(x, /*named_arg=*/0) in C++, and func(x, named_arg=0) in Python):

    • QString::number(pct, ‘f’, 1) in src/qt/modaloverlay.cpp (ModalOverlay::UpdateHeaderSyncLabel)
    • QString::number(pct, ‘f’, 1) in src/qt/modaloverlay.cpp (ModalOverlay::UpdateHeaderPresyncLabel)

    2026-03-28 12:54:29


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-07 19:20 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me