btck_chainstate_manager_options_set_database_cache_bytes

Set the total database cache used by the chainstate manager.

Synopsis

Declared in <kernel/bitcoinkernel.h>

[[nodiscard, __nonnull__]]
int
btck_chainstate_manager_options_set_database_cache_bytes(
    btck_ChainstateManagerOptions* chainstate_manager_options,
    uint64_t database_cache_bytes);

Description

The total cache is split internally between the block tree database, chainstate database, and in-memory coins cache. If this function is not called, the total cache defaults to 450 MiB.

Return Value

0 if the set was successful, non-zero if the set failed.

NOTE

The return value should not be discarded.

Parameters

NameDescription
chainstate_manager_options [in]Non-null, options to be set.
database_cache_bytes [in]The total database cache size in bytes. Values below 4 MiB are rejected. On 32-bit systems, values above 1 GiB are also rejected.