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

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK sedited, davidgumberg, mzumsande

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  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

  8. mzumsande commented at 5:44 AM on February 1, 2026: contributor

    utACK eeb4d2814803c09af602ca5c9810438dd5e987fb

  9. sedited merged this on Feb 2, 2026
  10. sedited closed this on Feb 2, 2026


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-04-30 21:12 UTC

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