mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-08 21:59:10 +02:00
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:
11
src/txdb.h
11
src/txdb.h
@@ -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/) */
|
||||
|
||||
Reference in New Issue
Block a user