Make nWalletDBUpdated atomic to avoid a potential race.

This commit is contained in:
Patrick Strateman
2016-11-26 19:32:30 -08:00
parent 76fec09d87
commit d63ff6265b
5 changed files with 43 additions and 33 deletions

View File

@@ -3508,7 +3508,7 @@ bool CWallet::InitLoadWallet()
walletInstance->ScanForWalletTransactions(pindexRescan, true);
LogPrintf(" rescan %15dms\n", GetTimeMillis() - nStart);
walletInstance->SetBestChain(chainActive.GetLocator());
nWalletDBUpdated++;
CWalletDB::IncrementUpdateCounter();
// Restore wallet transaction metadata after -zapwallettxes=1
if (GetBoolArg("-zapwallettxes", false) && GetArg("-zapwallettxes", "1") != "2")