| 367 | } |
| 368 | |
| 369 | void BerkeleyBatch::Flush() |
| 370 | { |
| 371 | if (activeTxn) |
| 372 | return; |
| 373 | |
| 374 | // Flush database activity from memory pool to disk log |
| 375 | unsigned int nMinutes = 0; |
| 376 | if (fReadOnly) |
| 377 | nMinutes = 1; |
| 378 | |
| 379 | if (env) { // env is nullptr for dummy databases (i.e. in tests). Don't actually flush if env is nullptr so we don't segfault |
| 380 | env->dbenv->txn_checkpoint(nMinutes ? gArgs.GetIntArg("-dblogsize", DEFAULT_WALLET_DBLOGSIZE) * 1024 : 0, nMinutes, 0); |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | void BerkeleyDatabase::IncrementUpdateCounter() |
| 385 | { |