File tree Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change @@ -631,7 +631,6 @@ class CWallet final : public WalletStorage, public interfaces::Chain::Notificati
631
631
std::atomic<bool > fScanningWallet {false }; // controlled by WalletRescanReserver
632
632
std::atomic<int64_t > m_scanning_start{0 };
633
633
std::atomic<double > m_scanning_progress{0 };
634
- std::mutex mutexScanning;
635
634
friend class WalletRescanReserver ;
636
635
637
636
// ! the current wallet version: clients below this version are not able to load the wallet
@@ -1286,13 +1285,11 @@ class WalletRescanReserver
1286
1285
bool reserve ()
1287
1286
{
1288
1287
assert (!m_could_reserve);
1289
- std::lock_guard<std::mutex> lock (m_wallet.mutexScanning );
1290
- if (m_wallet.fScanningWallet ) {
1288
+ if (m_wallet.fScanningWallet .exchange (true )) {
1291
1289
return false ;
1292
1290
}
1293
1291
m_wallet.m_scanning_start = GetTimeMillis ();
1294
1292
m_wallet.m_scanning_progress = 0 ;
1295
- m_wallet.fScanningWallet = true ;
1296
1293
m_could_reserve = true ;
1297
1294
return true ;
1298
1295
}
@@ -1304,7 +1301,6 @@ class WalletRescanReserver
1304
1301
1305
1302
~WalletRescanReserver ()
1306
1303
{
1307
- std::lock_guard<std::mutex> lock (m_wallet.mutexScanning );
1308
1304
if (m_could_reserve) {
1309
1305
m_wallet.fScanningWallet = false ;
1310
1306
}
You can’t perform that action at this time.
0 commit comments