Net processing now passes a BlockValidationState
object into ProcessNewBlock()
. If CheckBlock()
or AcceptBlock()
fails, then PNB returns to net processing without calling the (asynchronous) BlockChecked
Validation Interface method. net processing can use the invalid BlockValidationState
returned to punish peers.
CheckBlock()
and AcceptBlock()
represent the DoS checks on a block (ie PoW and malleability). Net processing wants to know about those failed checks immediately and shouldn’t have to wait on a callback. Other validation interface clients don’t care about net processing submitting bogus malleated blocks to validation, so they don’t need to be notified of BlockChecked
.
Furthermore, if PNB returns a valid BlockValidationState
, we never need to try to process (non-malleated) copies of the block from other peers. That makes it much easier to move the best chain activation logic to a background thread in future work.