diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 5d03a0b52c..e9049f3eeb 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -2410,6 +2410,7 @@ public: if (g_scan_in_progress.exchange(true)) { return false; } + CHECK_NONFATAL(g_scan_progress == 0); m_could_reserve = true; return true; } @@ -2417,6 +2418,7 @@ public: ~CoinsViewScanReserver() { if (m_could_reserve) { g_scan_in_progress = false; + g_scan_progress = 0; } } }; @@ -2535,7 +2537,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;