aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2021-07-30 10:20:35 +0800
committerfanquake <fanquake@gmail.com>2021-07-30 10:22:08 +0800
commit52778f42452dbb793b3827d209c9d44ce2c6592a (patch)
treea33052e9bbea7b379b4e906c45f30cf0c2cc4aa6
parent997e528a34185c68665d10cef43da883934ea03a (diff)
parent080b47d9ce6288e1725857b3026291981ef75e34 (diff)
downloadbitcoin-52778f42452dbb793b3827d209c9d44ce2c6592a.tar.xz
Merge bitcoin/bitcoin#22580: [0.21] Backport: Reset scantxoutset progress before inferring descriptors
080b47d9ce6288e1725857b3026291981ef75e34 rpc: reset scantxoutset progress on finish (Pavol Rusnak) Pull request description: Backport of #19362. ACKs for top commit: achow101: Code Review ACK 080b47d9ce6288e1725857b3026291981ef75e34 Tree-SHA512: 1f58965393663bfc0796fc06ef846bc87521d04d79c2a62227acf4d466de649db7d244c8992a32aa1086e6bf0ac92fb8a5aeadf4673441fefa505e40c02d5daf
-rw-r--r--src/rpc/blockchain.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp
index 90cf8d6d14..509107d88a 100644
--- a/src/rpc/blockchain.cpp
+++ b/src/rpc/blockchain.cpp
@@ -2109,6 +2109,7 @@ public:
if (g_scan_in_progress.exchange(true)) {
return false;
}
+ CHECK_NONFATAL(g_scan_progress == 0);
m_could_reserve = true;
return true;
}
@@ -2116,6 +2117,7 @@ public:
~CoinsViewScanReserver() {
if (m_could_reserve) {
g_scan_in_progress = false;
+ g_scan_progress = 0;
}
}
};
@@ -2228,7 +2230,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;