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

Returns how many blocks the best header is ahead of the current tip, or nullopt if the best header does not extend the tip&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;locks&lowbar;excluded(0x7f9513c48718), locks&lowbar;excluded(0x7f9502de9eb8), locks&lowbar;excluded(0x7f950b21c688), locks&lowbar;excluded(0x7f9514bf6678)&rsqb;&rsqb;
std::optional&lt;int&gt;
BlocksAheadOfTip() const;
----

== Return Value

The number of blocks the best header is ahead of the tip, or std&colon;&colon;nullopt&period;


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