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

Connect a single block to the tip, updating the mempool and coins view&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;requires&lowbar;capability(0x7f9513ab59b0, 0x7f9513ab5a28), requires&lowbar;capability(0x7f9502c98a20, 0x7f9502c98a98), requires&lowbar;capability(0x7f952544a750, 0x7f952544a7c8), requires&lowbar;capability(0x7f9517400a30, 0x7f9517400aa8)&rsqb;&rsqb;
bool
ConnectTip(
    xref:BlockValidationState.adoc[BlockValidationState]& state,
    xref:CBlockIndex.adoc[CBlockIndex]* pindexNew,
    std::shared&lowbar;ptr&lt;CBlock const&gt; block&lowbar;to&lowbar;connect,
    std::vector&lt;ConnectedBlock&gt;& connected&lowbar;blocks,
    xref:DisconnectedBlockTransactions.adoc[DisconnectedBlockTransactions]& disconnectpool);
----

== Return Value

true unless a system error occurred&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *state*
| Validation state updated with the reason for any failure&period;
| *pindexNew*
| Block index entry of the block being connected&period;
| *block&lowbar;to&lowbar;connect*
| The block to connect to the tip&period;
| *connected&lowbar;blocks*
| Collects the blocks connected during activation&period;
| *disconnectpool*
| Collects transactions from any disconnected blocks for reprocessing&period;
|===


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