[#btck_chainstate_manager_process_block] = btck_chainstate_manager_process_block :mrdocs: Process and validate the passed in block with the chainstate manager. Processing first does checks on the block, and if these passed, saves it to disk. It then validates the block against the utxo set. If it is valid, the chain is extended with it. The return value is not indicative of the block's validity. Detailed information on the validity of the block can be retrieved by registering the `block_checked` callback in the validation interface. == Synopsis Declared in `<kernel/bitcoinkernel.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard, __nonnull__]] int btck_chainstate_manager_process_block( xref:btck_ChainstateManager-0e.adoc[btck_ChainstateManager]* chainstate_manager, xref:btck_Block-04.adoc[btck_Block] const* block, int* new_block); ---- == Return Value 0 if processing the block was successful. Will also return 0 for valid, but duplicate blocks. [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Parameters [cols="1,4"] |=== | Name| Description | *chainstate_manager* [in] | Non‐null. | *block* [in] | Non‐null, block to be validated. | *new_block* [out] | Nullable, will be set to 1 if this block was not processed before. Note that this means it might also not be 1 if processing was attempted before, but the block was found invalid before its data was persisted. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#