[#Chainstate-2constructor]
= xref:Chainstate.adoc[Chainstate]::Chainstate
:relfileprefix: ../
:mrdocs:

Construct a chainstate&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
Chainstate(
    xref:CTxMemPool.adoc[CTxMemPool]* mempool,
    xref:node/BlockManager.adoc[node::BlockManager]& blockman,
    xref:ChainstateManager.adoc[ChainstateManager]& chainman,
    std::optional&lt;uint256&gt; from&lowbar;snapshot&lowbar;blockhash = std&colon;&colon;nullopt);
----

== Parameters

[cols="1,4"]
|===
| Name| Description
| *mempool*
| Optional mempool kept in sync with this chainstate (only the active chainstate has one)&period;
| *blockman*
| BlockManager instance shared across all chainstates&period;
| *chainman*
| The chainstate manager that owns this chainstate&period;
| *from&lowbar;snapshot&lowbar;blockhash*
| Base block hash if this chainstate was created from a snapshot, otherwise std&colon;&colon;nullopt&period;
|===


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