Perform context-free validation checks on a btck_Block.
Declared in <kernel/bitcoinkernel.h>
[[__nonnull__]]
int
btck_block_check(
btck_Block const* block,
btck_ConsensusParams const* consensus_params,
btck_BlockCheckFlags flags,
btck_BlockValidationState* validation_state);
Runs the base context-free block checks (size limits, coinbase structure, transaction checks, and sigop limits) using the supplied btck_ConsensusParams. The proof-of-work and merkle-root checks are optional and can be toggled via flags. Note that this does not include any transaction script, timestamps, order, or other checks that may require more context.
1 if the btck_Block passed the checks, 0 otherwise.
| Name | Description |
|---|---|
| block [in] | Non-null, btck_Block to validate. |
| consensus_params [in] | Non-null, btck_ConsensusParams for validation. |
| flags [in] | Bitmask of btck_BlockCheckFlags controlling the optional POW and merkle-root checks. Use btck_BlockCheckFlags_BASE to run only the base checks. |
| validation_state [out] | Non-null, previously created with btck_block_validation_state_create. Overwritten in-place with the validation result. |