Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/db.cpp
Show First 20 Lines • Show All 628 Lines • ▼ Show 20 Lines | void BerkeleyBatch::Flush() { | ||||
} | } | ||||
// Flush database activity from memory pool to disk log | // Flush database activity from memory pool to disk log | ||||
unsigned int nMinutes = 0; | unsigned int nMinutes = 0; | ||||
if (fReadOnly) { | if (fReadOnly) { | ||||
nMinutes = 1; | nMinutes = 1; | ||||
} | } | ||||
// env is nullptr for dummy databases (i.e. in tests). Don't actually flush | |||||
// if env is nullptr so we don't segfault | |||||
if (env) { | |||||
env->dbenv->txn_checkpoint( | env->dbenv->txn_checkpoint( | ||||
nMinutes ? gArgs.GetArg("-dblogsize", DEFAULT_WALLET_DBLOGSIZE) * 1024 | nMinutes | ||||
? gArgs.GetArg("-dblogsize", DEFAULT_WALLET_DBLOGSIZE) * 1024 | |||||
: 0, | : 0, | ||||
nMinutes, 0); | nMinutes, 0); | ||||
} | } | ||||
} | |||||
void BerkeleyDatabase::IncrementUpdateCounter() { | void BerkeleyDatabase::IncrementUpdateCounter() { | ||||
++nUpdateCounter; | ++nUpdateCounter; | ||||
} | } | ||||
void BerkeleyBatch::Close() { | void BerkeleyBatch::Close() { | ||||
if (!pdb) { | if (!pdb) { | ||||
return; | return; | ||||
▲ Show 20 Lines • Show All 332 Lines • Show Last 20 Lines |