[#btck_chainstate_manager_get_active_chain]
= btck&lowbar;chainstate&lowbar;manager&lowbar;get&lowbar;active&lowbar;chain
:mrdocs:

Returns the best known currently active chain&period; Its lifetime is dependent on the chainstate manager&period; It can be thought of as a view on a vector of block tree entries that form the best chain&period; The returned chain reference always points to the currently active best chain&period; However, state transitions within the chainstate manager (e&period;g&period;, processing blocks) will update the chain&apos;s contents&period; Data retrieved from this chain is only consistent up to the point when new data is processed in the chainstate manager&period; It is the user&apos;s responsibility to guard against these inconsistencies&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;&lowbar;&lowbar;nonnull&lowbar;&lowbar;&rsqb;&rsqb;
xref:btck_Chain-09.adoc[btck&lowbar;Chain] const*
btck&lowbar;chainstate&lowbar;manager&lowbar;get&lowbar;active&lowbar;chain(xref:btck_ChainstateManager-0e.adoc[btck&lowbar;ChainstateManager] const* chainstate&lowbar;manager);
----

== Return Value

The chain&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *chainstate&lowbar;manager* [in]
| Non&hyphen;null&period;
|===


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