[#CBlockIndex-GetAncestor-09]
= xref:CBlockIndex.adoc[CBlockIndex]::GetAncestor
:relfileprefix: ../
:mrdocs:

Efficiently find an ancestor of this block&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:CBlockIndex.adoc[CBlockIndex]*
GetAncestor(int height);
----

== Return Value

The ancestor at the given height, or nullptr if none exists&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *height*
| The height of the ancestor to find&period;
|===


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