When I researched for the answer on What happens in detail, when Bitcoin Core verifies a block during synchronization?, I noticed something:
According to the Wiki-Entry on Protocol rules some of the transactions' traits are checked before all header data is verified.
Why do the following checks of difficulty statement and timestamp get performed only after transactions get looked at?
- Check if prev block (matching prev hash) is in main branch or side branches. If not, add this to orphan blocks, then query peer we got this from for 1st missing orphan block in prev chain; done with block
- Check that nBits value matches the difficulty rules
- Reject if timestamp is the median time of the last 11 blocks or before
Wouldn't it be more efficient to check the relation to the main chain and timestamp first, and then check the legality of the transactions?