Removes most of the undesired dependencies from the consensus pow functions. CBlockIndex is still used, but only its attributes and none of the methods. This is part of #5995. It also relates with some miner PRs (like #4793 or #5957) since this will stop those log messages in regtest, allowing those PRs to use CheckProofOfWork directly in ScanHash. I believe that’s something that at least @sipa and @21E14 will like.
Questions:
-Is it worth it to create miner::GetNextWorkRequiredLog() ? -Should CheckProofOfWork() receive a reference to a CValidationState to be able to give the specific reason when it returns false?