Merge #9227: Make nWalletDBUpdated atomic to avoid a potential race.

d63ff62 Make nWalletDBUpdated atomic to avoid a potential race. (Patrick Strateman)
This commit is contained in:
Wladimir J. van der Laan
2017-02-06 15:01:49 +01:00
5 changed files with 43 additions and 33 deletions

View File

@@ -3691,7 +3691,7 @@ CWallet* CWallet::CreateWalletFromFile(const std::string walletFile)
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")