Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/walletdb.cpp
Show First 20 Lines • Show All 930 Lines • ▼ Show 20 Lines | DBErrors WalletBatch::ZapWalletTx(std::vector<CWalletTx> &vWtx) { | ||||
return DBErrors::LOAD_OK; | return DBErrors::LOAD_OK; | ||||
} | } | ||||
void MaybeCompactWalletDB() { | 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)) { | |||||
return; | |||||
} | |||||
for (const std::shared_ptr<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; | ||||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |