Skip to content

Commit 8c4129b

Browse files
committed
rpc: reset scantxoutset progress on finish
1 parent 007e15d commit 8c4129b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/rpc/blockchain.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2021,13 +2021,15 @@ class CoinsViewScanReserver
20212021
if (g_scan_in_progress.exchange(true)) {
20222022
return false;
20232023
}
2024+
CHECK_NONFATAL(g_scan_progress == 0);
20242025
m_could_reserve = true;
20252026
return true;
20262027
}
20272028

20282029
~CoinsViewScanReserver() {
20292030
if (m_could_reserve) {
20302031
g_scan_in_progress = false;
2032+
g_scan_progress = 0;
20312033
}
20322034
}
20332035
};
@@ -2140,7 +2142,6 @@ UniValue scantxoutset(const JSONRPCRequest& request)
21402142
std::vector<CTxOut> input_txos;
21412143
std::map<COutPoint, Coin> coins;
21422144
g_should_abort_scan = false;
2143-
g_scan_progress = 0;
21442145
int64_t count = 0;
21452146
std::unique_ptr<CCoinsViewCursor> pcursor;
21462147
CBlockIndex* tip;

0 commit comments

Comments
 (0)