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

Set target block for this chainstate&period; If null, chainstate will target the most&hyphen;work valid block&period; If non&hyphen;null chainstate will be a historic chainstate and target the specified block&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;requires&lowbar;capability(0x7f9513ab4038), requires&lowbar;capability(0x7f9502c970a8), requires&lowbar;capability(0x7f9525448dd8), requires&lowbar;capability(0x7f95173ff0b8)&rsqb;&rsqb;
void
SetTargetBlock(xref:CBlockIndex.adoc[CBlockIndex]* block);
----

== Parameters

[cols="1,4"]
|===
| Name| Description
| *block*
| The target block, or nullptr to target the most&hyphen;work valid block&period;
|===


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