[#CValidationInterface-ChainStateFlushed]
= xref:CValidationInterface.adoc[CValidationInterface]::ChainStateFlushed
:relfileprefix: ../
:mrdocs:

Notifies listeners of the new active block chain on&hyphen;disk&period;

== Synopsis

Declared in `&lt;validationinterface&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
virtual
void
ChainStateFlushed(
    xref:kernel/ChainstateRole.adoc[kernel::ChainstateRole] const& role,
    xref:CBlockLocator.adoc[CBlockLocator] const& locator);
----

== Description

Prior to this callback, any updates are not guaranteed to persist on disk (ie clients need to handle shutdown&sol;restart safety by being able to understand when some updates were lost due to unclean shutdown)&period;

When this callback is invoked, the validation changes done by any prior callback are guaranteed to exist on disk and survive a restart, including an unclean shutdown&period;

Provides a locator describing the best chain, which is likely useful for storing current state on disk in client DBs&period;

Called on a background thread&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *role*
| Which chainstate (active or background) was flushed&period;
| *locator*
| Locator describing the best chain at flush time&period;
|===


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