[#node-BlockManager-AddToBlockIndex]
= xref:node.adoc[node]::xref:node/BlockManager.adoc[BlockManager]::AddToBlockIndex
:relfileprefix: ../../
:mrdocs:

Add a block header to the in&hyphen;memory block index, updating the best header&period;

== Synopsis

Declared in `&lt;node&sol;blockstorage&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;requires&lowbar;capability(0x7f95130c9018), requires&lowbar;capability(0x7f950163c308), requires&lowbar;capability(0x7f95241d92f8), requires&lowbar;capability(0x7f951f3305f8), requires&lowbar;capability(0x7f950b9c25b8), requires&lowbar;capability(0x7f95175c4d08)&rsqb;&rsqb;
xref:CBlockIndex.adoc[CBlockIndex]*
AddToBlockIndex(
    xref:CBlockHeader.adoc[CBlockHeader] const& block,
    xref:CBlockIndex.adoc[CBlockIndex]*& best&lowbar;header);
----

== Return Value

The block index entry for `block&period;`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *block*
| The block header to add&period;
| *best&lowbar;header*
| Reference to the best&hyphen;header pointer, updated if this block is better&period;
|===


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