Process an incoming block. This only returns after the best known valid block is made active. Note that it does not, however, guarantee that the specific block passed to it has been checked for validity!
Declared in <validation.h>
[[locks_excluded(0x7f2e1bc178e8), locks_excluded(0x7f2e146b5c38), locks_excluded(0x7f2e298fb008), locks_excluded(0x7f2e360b8768)]]
bool
ProcessNewBlock(
std::shared_ptr<CBlock const> const& block,
bool force_processing,
bool min_pow_checked,
bool* new_block);
If you want to possibly get feedback on whether block is valid, you must install a CValidationInterface (see validationinterface.h) - this will have its BlockChecked method called whenever any block completes validation.
Note that we guarantee that either the proof-of-work is valid on block, or (and possibly also) BlockChecked will have been called.
May not be called in a validationinterface callback.
If the block was processed, independently of block validity
| Name | Description |
|---|---|
| block [in] | The block we want to process. |
| force_processing [in] | Process this block even if unrequested; used for non-network block sources. |
| min_pow_checked [in] | True if proof-of-work anti-DoS checks have been done by caller for headers chain (note: only affects headers acceptance; if block header is already present in block index then this parameter has no effect) |
| new_block [out] | A boolean which is set to indicate if the block was first received via this call |