Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/walletdb.cpp
Show First 20 Lines • Show All 563 Lines • ▼ Show 20 Lines | try { | ||||
result = DB_CORRUPT; | result = DB_CORRUPT; | ||||
} else { | } else { | ||||
// Leave other errors alone, if we try to fix them we might | // Leave other errors alone, if we try to fix them we might | ||||
// make things worse. But do warn the user there is | // make things worse. But do warn the user there is | ||||
// something wrong. | // something wrong. | ||||
fNoncriticalErrors = true; | fNoncriticalErrors = true; | ||||
if (strType == "tx") { | if (strType == "tx") { | ||||
// Rescan if there is a bad transaction record: | // Rescan if there is a bad transaction record: | ||||
SoftSetBoolArg("-rescan", true); | gArgs.SoftSetBoolArg("-rescan", true); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if (!strErr.empty()) { | if (!strErr.empty()) { | ||||
LogPrintf("%s\n", strErr); | LogPrintf("%s\n", strErr); | ||||
} | } | ||||
} | } | ||||
pcursor->close(); | pcursor->close(); | ||||
▲ Show 20 Lines • Show All 172 Lines • ▼ Show 20 Lines | DBErrors CWalletDB::ZapWalletTx(std::vector<CWalletTx> &vWtx) { | ||||
return DB_LOAD_OK; | return DB_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 (!GetBoolArg("-flushwallet", DEFAULT_FLUSHWALLET)) { | if (!gArgs.GetBoolArg("-flushwallet", DEFAULT_FLUSHWALLET)) { | ||||
return; | return; | ||||
} | } | ||||
for (CWalletRef pwallet : vpwallets) { | for (CWalletRef pwallet : vpwallets) { | ||||
CWalletDBWrapper &dbh = pwallet->GetDBHandle(); | CWalletDBWrapper &dbh = pwallet->GetDBHandle(); | ||||
unsigned int nUpdateCounter = dbh.nUpdateCounter; | unsigned int nUpdateCounter = dbh.nUpdateCounter; | ||||
▲ Show 20 Lines • Show All 119 Lines • Show Last 20 Lines |