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

Process an incoming block&period; This only returns after the best known valid block is made active&period; Note that it does not, however, guarantee that the specific block passed to it has been checked for validity!

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;locks&lowbar;excluded(0x7f2e1bc178e8), locks&lowbar;excluded(0x7f2e146b5c38), locks&lowbar;excluded(0x7f2e298fb008), locks&lowbar;excluded(0x7f2e360b8768)&rsqb;&rsqb;
bool
ProcessNewBlock(
    std::shared&lowbar;ptr&lt;CBlock const&gt; const& block,
    bool force&lowbar;processing,
    bool min&lowbar;pow&lowbar;checked,
    bool* new&lowbar;block);
----

== Description

If you want to _possibly_ get feedback on whether block is valid, you must install a CValidationInterface (see validationinterface&period;h) &hyphen; this will have its BlockChecked method called whenever _any_ block completes validation&period;

Note that we guarantee that either the proof&hyphen;of&hyphen;work is valid on block, or (and possibly also) BlockChecked will have been called&period;

May not be called in a validationinterface callback&period;

== Return Value

If the block was processed, independently of block validity

== Parameters

[cols="1,4"]
|===
| Name| Description
| *block* [in]
| The block we want to process&period;
| *force&lowbar;processing* [in]
| Process this block even if unrequested&semi; used for non&hyphen;network block sources&period;
| *min&lowbar;pow&lowbar;checked* [in]
| True if proof&hyphen;of&hyphen;work anti&hyphen;DoS checks have been done by caller for headers chain (note&colon; only affects headers acceptance&semi; if block header is already present in block index then this parameter has no effect)
| *new&lowbar;block* [out]
| A boolean which is set to indicate if the block was first received via this call
|===


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