Skip to content

Commit 3e306ee

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#19362: rpc/blockchain: Reset scantxoutset progress before inferring descriptors
8c4129b rpc: reset scantxoutset progress on finish (Pavol Rusnak) Pull request description: Fixes bitcoin/bitcoin#19361 by moving resetting the `g_scan_progress` variable **before** inferring the descriptors ACKs for top commit: achow101: Code review ACK 8c4129b Tree-SHA512: 2b81e5c930b9c201a1b9cc742c37e0617582326acd9adbd6b14991d33c05d51b1d5ff6a26f3accab7d274dc8c6a48bc8cbccf0811b60c1f76dd805f9b31482c0
2 parents 246daf1 + 8c4129b commit 3e306ee

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
@@ -2258,13 +2258,15 @@ class CoinsViewScanReserver
22582258
if (g_scan_in_progress.exchange(true)) {
22592259
return false;
22602260
}
2261+
CHECK_NONFATAL(g_scan_progress == 0);
22612262
m_could_reserve = true;
22622263
return true;
22632264
}
22642265

22652266
~CoinsViewScanReserver() {
22662267
if (m_could_reserve) {
22672268
g_scan_in_progress = false;
2269+
g_scan_progress = 0;
22682270
}
22692271
}
22702272
};
@@ -2381,7 +2383,6 @@ static RPCHelpMan scantxoutset()
23812383
std::vector<CTxOut> input_txos;
23822384
std::map<COutPoint, Coin> coins;
23832385
g_should_abort_scan = false;
2384-
g_scan_progress = 0;
23852386
int64_t count = 0;
23862387
std::unique_ptr<CCoinsViewCursor> pcursor;
23872388
CBlockIndex* tip;

0 commit comments

Comments
 (0)