Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/walletdb.cpp
Show First 20 Lines • Show All 756 Lines • ▼ Show 20 Lines | void MaybeCompactWalletDB() { | ||||
static std::atomic<bool> fOneThread; | static std::atomic<bool> fOneThread; | ||||
if (fOneThread.exchange(true)) { | if (fOneThread.exchange(true)) { | ||||
return; | return; | ||||
} | } | ||||
if (!gArgs.GetBoolArg("-flushwallet", DEFAULT_FLUSHWALLET)) { | if (!gArgs.GetBoolArg("-flushwallet", DEFAULT_FLUSHWALLET)) { | ||||
return; | return; | ||||
} | } | ||||
for (CWallet *pwallet : GetWallets()) { | for (const std::shared_ptr<CWallet> &pwallet : GetWallets()) { | ||||
WalletDatabase &dbh = pwallet->GetDBHandle(); | WalletDatabase &dbh = pwallet->GetDBHandle(); | ||||
unsigned int nUpdateCounter = dbh.nUpdateCounter; | unsigned int nUpdateCounter = dbh.nUpdateCounter; | ||||
if (dbh.nLastSeen != nUpdateCounter) { | if (dbh.nLastSeen != nUpdateCounter) { | ||||
dbh.nLastSeen = nUpdateCounter; | dbh.nLastSeen = nUpdateCounter; | ||||
dbh.nLastWalletUpdate = GetTime(); | dbh.nLastWalletUpdate = GetTime(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 114 Lines • Show Last 20 Lines |