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

Sufficiently validate a block for disk storage (and store on disk)&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;requires&lowbar;capability(0x7f2e1bc17a28), requires&lowbar;capability(0x7f2e146b5d78), requires&lowbar;capability(0x7f2e298fb148), requires&lowbar;capability(0x7f2e360b88a8)&rsqb;&rsqb;
bool
AcceptBlock(
    std::shared&lowbar;ptr&lt;CBlock const&gt; const& pblock,
    xref:BlockValidationState.adoc[BlockValidationState]& state,
    xref:CBlockIndex.adoc[CBlockIndex]** ppindex,
    bool fRequested,
    xref:FlatFilePos.adoc[FlatFilePos] const* dbp,
    bool* fNewBlock,
    bool min&lowbar;pow&lowbar;checked);
----

== Return Value

False if the block or header is invalid, or if saving to disk fails (likely a fatal error)&semi; true otherwise&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *pblock* [in]
| The block we want to process&period;
| *fRequested* [in]
| Whether we requested this block from a peer&period;
| *dbp* [in]
| The location on disk, if we are importing this block from prior storage&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
| *state* [out]
| The state of the block validation&period;
| *ppindex* [out]
| Optional return parameter to get the CBlockIndex pointer for this block&period;
| *fNewBlock* [out]
| Optional return parameter to indicate if the block is new to our storage&period;
|===


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