[#ChainstateManager-ValidatedSnapshotCleanup]
= xref:ChainstateManager.adoc[ChainstateManager]::ValidatedSnapshotCleanup
:relfileprefix: ../
:mrdocs:

If we have validated a snapshot chain during this runtime, copy its chainstate directory over to the main `chainstate` location, completing validation of the snapshot&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;requires&lowbar;capability(0x7f9513c483d8), requires&lowbar;capability(0x7f9502de9b78), requires&lowbar;capability(0x7f950b21c348), requires&lowbar;capability(0x7f9514bf6338)&rsqb;&rsqb;
bool
ValidatedSnapshotCleanup(
    xref:Chainstate.adoc[Chainstate]& validated&lowbar;cs,
    xref:Chainstate.adoc[Chainstate]& unvalidated&lowbar;cs);
----

== Description

If the cleanup succeeds, the caller will need to ensure chainstates are reinitialized, since ResetChainstates() will be called before leveldb directories are moved or deleted&period;

== Return Value

true if the cleanup completed successfully&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *validated&lowbar;cs*
| The validated chainstate whose directory is moved into place&period;
| *unvalidated&lowbar;cs*
| The snapshot chainstate that is being superseded&period;
|===


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