ProcessNewBlock
would return failure early if CheckBlock
failed, before calling AcceptBlock
. AcceptBlock
also calls CheckBlock
, and upon failure would update mapBlockIndex
to indicate that a block was failed. By returning early in ProcessNewBlock
, we were not marking blocks that fail a check in CheckBlock
as permanently failed, and thus would continue to re-request and reprocess them.
This should result in one fewer call to CheckBlock
for valid blocks, at the expense of one extra call to AcceptBlockHeader
for blocks that fail CheckBlock
, and it avoids reprocessing those failed blocks over and over.