GUARDED_BY annotations for nTx, m_chain_tx_count #36876

pull Crypt-iQ wants to merge 1 commits into bitcoin:master from Crypt-iQ:2026-11/cblockindex-guard changing 5 files +16 −7
  1. Crypt-iQ commented at 9:37 PM on November 14, 2026: contributor

    The cs_main requirement was never made explicit. The nTx field is modified when the block data is received and m_chain_tx_count is modified when all ancestors' block data has been received. Because of this, reading nTx from the getblockheader RPC may race as it does not acquire cs_main. Also, m_chain_tx_count may race in getchaintxstats if a pruned node redownloads a block via getblockfrompeer or if the node is running assumeutxo and tries to read m_chain_tx_count while it is being written to.

  2. GUARDED_BY annotations for CBlockIndex's nTx, m_chain_tx_count
    The requirement was never made explicit. The nTx field is modified
    when the block data is received and m_chain_tx_count is modified
    when all ancestors' block data has been received. Because of this,
    reading nTx from the getblockheader RPC may race as it does not
    acquire cs_main. Also, m_chain_tx_count may race in getchaintxstats
    if a pruned node redownloads a block via getblockfrompeer or if
    the node is running assumeutxo and tries to read m_chain_tx_count
    while it is being written to.
    8775bebbde
  3. DrahtBot commented at 9:37 PM on November 14, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. fanquake commented at 2:20 AM on November 15, 2026: member

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-11-16 00:51 UTC

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