validation: follow-up nits for lock-free IsInitialBlockDownload() #34443

pull l0rinc wants to merge 1 commits into bitcoin:master from l0rinc:34253_followup_nits changing 2 files +4 −8
  1. l0rinc commented at 11:31 am on January 29, 2026: contributor

    Innocent follow-up to #34253:

    • Add AssertLockHeld(cs_main) to ChainstateManager::UpdateIBDStatus() given it’s already annotated with EXCLUSIVE_LOCKS_REQUIRED(cs_main).
    • Fix outdated comment about constness of ChainstateManager::IsInitialBlockDownload() (compilation and build passes without it).
    • And since we’re touching it, we might as well mark ChainstateManager::IsInitialBlockDownload() as noexcept now.
  2. validation: follow-up nits for lock-free `IsInitialBlockDownload()`
    Add `AssertLockHeld(cs_main)` to `ChainstateManager::UpdateIBDStatus()` given `EXCLUSIVE_LOCKS_REQUIRED(cs_main)`.
    Fix outdated comment about constness of `ChainstateManager::IsInitialBlockDownload()` (build passes without it).
    And since we're touching it, we might as well mark `ChainstateManager::IsInitialBlockDownload()` as `noexcept` now.
    
    Follow-up to #34253.
    
    Co-authored-by: Martin Zumsande <mzumsande@gmail.com>
    eeb4d28148
  3. DrahtBot added the label Validation on Jan 29, 2026
  4. DrahtBot commented at 11:32 am on January 29, 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.

    Type Reviewers
    ACK sedited, davidgumberg

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

  5. in src/validation.cpp:1938 in eeb4d28148
    1940-// It is lock-free and depends on `m_cached_is_ibd`, which is latched by
    1941-// `UpdateIBDStatus()`.
    1942-//
    1943-bool ChainstateManager::IsInitialBlockDownload() const
    1944+// Lock-free: depends on `m_cached_is_ibd`, which is latched by `UpdateIBDStatus()`.
    1945+bool ChainstateManager::IsInitialBlockDownload() const noexcept
    


    sedited commented at 12:16 pm on January 29, 2026:
    I’m still not sure when it is actually a good time to add noexcept, but this one seems harmless, since load(...) is already noexcept.

    l0rinc commented at 12:22 pm on January 29, 2026:
    I usually add noexcept when I want to document that an exception from this method should crash the application
  6. sedited approved
  7. sedited commented at 12:19 pm on January 29, 2026: contributor
    ACK eeb4d2814803c09af602ca5c9810438dd5e987fb

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-01-29 21:13 UTC

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