diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-06-25 11:21:29 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-06-25 11:21:33 +0200 |
commit | 3e306ee1d5c79eda64eb991fb2696bf530f0b30d (patch) | |
tree | 2efac58a6976cc4d7f855868ff46add93c4698a2 /src/rpc/blockchain.cpp | |
parent | 246daf1f537d4b7a39774b22db86ed1931b7819b (diff) | |
parent | 8c4129b4540f4f739413ed9a6fbfc78afc252f42 (diff) | |
download | bitcoin-3e306ee1d5c79eda64eb991fb2696bf530f0b30d.tar.xz |
Merge bitcoin/bitcoin#19362: rpc/blockchain: Reset scantxoutset progress before inferring descriptors
8c4129b4540f4f739413ed9a6fbfc78afc252f42 rpc: reset scantxoutset progress on finish (Pavol Rusnak)
Pull request description:
Fixes https://github.com/bitcoin/bitcoin/issues/19361 by moving resetting the `g_scan_progress` variable **before** inferring the descriptors
ACKs for top commit:
achow101:
Code review ACK 8c4129b4540f4f739413ed9a6fbfc78afc252f42
Tree-SHA512: 2b81e5c930b9c201a1b9cc742c37e0617582326acd9adbd6b14991d33c05d51b1d5ff6a26f3accab7d274dc8c6a48bc8cbccf0811b60c1f76dd805f9b31482c0
Diffstat (limited to 'src/rpc/blockchain.cpp')
-rw-r--r-- | src/rpc/blockchain.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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<CTxOut> input_txos; std::map<COutPoint, Coin> coins; g_should_abort_scan = false; - g_scan_progress = 0; int64_t count = 0; std::unique_ptr<CCoinsViewCursor> pcursor; CBlockIndex* tip; |