[#btck_chainstate_manager_options_set_database_cache_bytes]
= btck&lowbar;chainstate&lowbar;manager&lowbar;options&lowbar;set&lowbar;database&lowbar;cache&lowbar;bytes
:mrdocs:

Set the total database cache used by the chainstate manager&period;

== Synopsis

Declared in `&lt;kernel&sol;bitcoinkernel&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard, &lowbar;&lowbar;nonnull&lowbar;&lowbar;&rsqb;&rsqb;
int
btck&lowbar;chainstate&lowbar;manager&lowbar;options&lowbar;set&lowbar;database&lowbar;cache&lowbar;bytes(
    xref:btck_ChainstateManagerOptions-08.adoc[btck&lowbar;ChainstateManagerOptions]* chainstate&lowbar;manager&lowbar;options,
    uint64&lowbar;t database&lowbar;cache&lowbar;bytes);
----

== Description

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

== Return Value

0 if the set was successful, non&hyphen;zero if the set failed&period;

[NOTE]
====
The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^].
====
== Parameters

[cols="1,4"]
|===
| Name| Description
| *chainstate&lowbar;manager&lowbar;options* [in]
| Non&hyphen;null, options to be set&period;
| *database&lowbar;cache&lowbar;bytes* [in]
| The total database cache size in bytes&period; Values below 4 MiB are rejected&period; On 32&hyphen;bit systems, values above 1 GiB are also rejected&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
