rpc: reset scantxoutset progress on finish

Github-Pull: #19362
Rebased-From: 8c4129b454
This commit is contained in:
Pavol Rusnak 2020-07-24 11:03:31 +02:00 committed by fanquake
parent 997e528a34
commit 080b47d9ce
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1

View file

@ -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;