mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Have WalletBatch automatically flush every 1000 updates
Since it now automatically flushes, we don't need to have UpgradeKeyMetadata count and flush separately
This commit is contained in:
@@ -614,7 +614,9 @@ void BerkeleyBatch::Flush()
|
||||
if (fReadOnly)
|
||||
nMinutes = 1;
|
||||
|
||||
env->dbenv->txn_checkpoint(nMinutes ? gArgs.GetArg("-dblogsize", DEFAULT_WALLET_DBLOGSIZE) * 1024 : 0, nMinutes, 0);
|
||||
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
|
||||
env->dbenv->txn_checkpoint(nMinutes ? gArgs.GetArg("-dblogsize", DEFAULT_WALLET_DBLOGSIZE) * 1024 : 0, nMinutes, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void BerkeleyDatabase::IncrementUpdateCounter()
|
||||
|
||||
Reference in New Issue
Block a user