diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 4d4d3fb7d0..f996aa9c76 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -2258,6 +2258,7 @@ public: if (g_scan_in_progress.exchange(true)) { return false; } + CHECK_NONFATAL(g_scan_progress == 0); m_could_reserve = true; return true; } @@ -2265,6 +2266,7 @@ public: ~CoinsViewScanReserver() { if (m_could_reserve) { g_scan_in_progress = false; + g_scan_progress = 0; } } }; @@ -2381,7 +2383,6 @@ static RPCHelpMan scantxoutset() std::vector input_txos; std::map coins; g_should_abort_scan = false; - g_scan_progress = 0; int64_t count = 0; std::unique_ptr pcursor; CBlockIndex* tip;