[#Chainstate-FlushStateToDisk] = xref:Chainstate.adoc[Chainstate]::FlushStateToDisk :relfileprefix: ../ :mrdocs: Update the on‐disk chain state. The caches and indexes are flushed depending on the mode we're called with if they're too large, if it's been a while since the last write, or always and in all cases if we're in prune mode and are deleting files. == Synopsis Declared in `<validation.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- bool FlushStateToDisk( xref:BlockValidationState.adoc[BlockValidationState]& state, xref:FlushStateMode.adoc[FlushStateMode] mode, int nManualPruneHeight = 0); ---- == Description If FlushStateMode::NONE is used, then FlushStateToDisk(...) won't do anything besides checking if we need to prune. == Return Value true unless a system error occurred == Parameters [cols="1,4"] |=== | Name| Description | *state* [in] | Validation state updated if a system error occurs. | *mode* [in] | How aggressively to flush the caches to disk. | *nManualPruneHeight* [in] | Height up to which to manually prune, or 0 for none. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#