[#btck_block_check]
= btck&lowbar;block&lowbar;check
:mrdocs:

Perform context&hyphen;free validation checks on a btck&lowbar;Block&period;

== Synopsis

Declared in `&lt;kernel&sol;bitcoinkernel&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;&lowbar;&lowbar;nonnull&lowbar;&lowbar;&rsqb;&rsqb;
int
btck&lowbar;block&lowbar;check(
    xref:btck_Block-04.adoc[btck&lowbar;Block] const* block,
    xref:btck_ConsensusParams-08.adoc[btck&lowbar;ConsensusParams] const* consensus&lowbar;params,
    xref:btck_BlockCheckFlags.adoc[btck&lowbar;BlockCheckFlags] flags,
    xref:btck_BlockValidationState-0e.adoc[btck&lowbar;BlockValidationState]* validation&lowbar;state);
----

== Description

Runs the base context&hyphen;free block checks (size limits, coinbase structure, transaction checks, and sigop limits) using the supplied btck&lowbar;ConsensusParams&period; The proof&hyphen;of&hyphen;work and merkle&hyphen;root checks are optional and can be toggled via `flags&period;` Note that this does not include any transaction script, timestamps, order, or other checks that may require more context&period;

== Return Value

1 if the btck&lowbar;Block passed the checks, 0 otherwise&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *block* [in]
| Non&hyphen;null, btck&lowbar;Block to validate&period;
| *consensus&lowbar;params* [in]
| Non&hyphen;null, btck&lowbar;ConsensusParams for validation&period;
| *flags* [in]
| Bitmask of btck&lowbar;BlockCheckFlags controlling the optional POW and merkle&hyphen;root checks&period; Use btck&lowbar;BlockCheckFlags&lowbar;BASE to run only the base checks&period;
| *validation&lowbar;state* [out]
| Non&hyphen;null, previously created with btck&lowbar;block&lowbar;validation&lowbar;state&lowbar;create&period; Overwritten in&hyphen;place with the validation result&period;
|===


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