refactor: Extract default batch size into kernel

The constant for the default batch size is moved to `kernel/caches.h` to consolidate kernel-related cache constants.
This commit is contained in:
Lőrinc
2025-08-27 21:20:35 -07:00
parent 6ca6f3b37b
commit 8bbb7b8bf8
3 changed files with 8 additions and 8 deletions

View File

@@ -8,6 +8,7 @@
#include <coins.h>
#include <dbwrapper.h>
#include <kernel/caches.h>
#include <kernel/cs_main.h>
#include <sync.h>
#include <util/fs.h>
@@ -21,16 +22,12 @@
class COutPoint;
class uint256;
//! -dbbatchsize default (bytes)
static const int64_t nDefaultDbBatchSize = 16 << 20;
//! User-controlled performance and debug options.
struct CoinsViewOptions {
//! Maximum database write batch size in bytes.
size_t batch_write_bytes = nDefaultDbBatchSize;
//! If non-zero, randomly exit when the database is flushed with (1/ratio)
//! probability.
int simulate_crash_ratio = 0;
size_t batch_write_bytes{DEFAULT_DB_CACHE_BATCH};
//! If non-zero, randomly exit when the database is flushed with (1/ratio) probability.
int simulate_crash_ratio{0};
};
/** CCoinsView backed by the coin database (chainstate/) */