wallet: Update tx chain state during loading during AttachChain instead of before #35294

pull achow101 wants to merge 2 commits into bitcoin:master from achow101:wallet-chain-load-inconsistency changing 3 files +77 −5
  1. achow101 commented at 12:15 AM on May 15, 2026: member

    When loading a wallet, updating the state based on the chain data prior to AttachChain results in some blocks being missed, which leads to inconsistent state information that can cause assertion failures. Moving the state updating inside of AttachChain after the chain notifications handler has been attached ensures that the state will always be up to date with the tip that the wallet is tracking.

    Fixes #34599

  2. wallet: Update tx chain state after chain notifications are attached
    Updating transactions against the current chain state can only be done
    in AttachChain after chain notifications have been attached. AttachChain
    will guarantee that any blocks missing between the stored best block and
    the current tip are rescanned, and any blocks connected during
    AttachChain will be processed after loading completes.
    
    This fixes an issue where tx states were updated with no guarantee that
    any blocks connected prior to AttachChain are scanned, resulting in
    incorrect tx states.
    4d95950972
  3. test: Check all wallet tx states are correct after unclean shutdown 29e29bd9d8
  4. DrahtBot added the label Wallet on May 15, 2026
  5. DrahtBot commented at 12:15 AM on May 15, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35294.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  6. DrahtBot added the label CI failed on May 15, 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-05-18 06:12 UTC

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