rpc: fix a race between `scantxoutset` calls #36959

pull l0rinc wants to merge 1 commits into bitcoin:master from l0rinc:l0rinc/scantxoutset-reset-progress changing 1 files +1 −1
  1. l0rinc commented at 11:09 AM on November 24, 2026: contributor

    Problem: Overlapping scantxoutset calls can leave the node reporting "Scan already in progress" until restart, even though the scan has finished. A new caller can acquire the reservation while progress from the previous scan is still nonzero. The progress check then throws before the caller records that it owns the reservation, so its destructor never releases it.

    Fix: Reset progress while the finishing scan still holds the reservation.

    Historical context: Luke pointed out that a failed progress check could block all future scans.

  2. rpc: reset scantxoutset progress before allowing a new scan
    Once a scan clears g_scan_in_progress, another caller can acquire the reservation and check g_scan_progress before the old scan resets it.
    Reset progress first so the new caller sees zero as expected.
    5043b75e01
  3. DrahtBot added the label RPC/REST/ZMQ on Nov 24, 2026
  4. DrahtBot commented at 11:09 AM on November 24, 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-->


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-25 17:51 UTC

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