This is the first step to later make a single “ConsensusFlags” type or enum.
When VerifyBlock and VerifyTx will be in libconsensus, the lib will probably still not have access to CBlockIndex. The user of libconsensus would be responsible for giving the ConsensusFlags. (as done now with EvalScript)
The ConsensusFlag calculation will thus be a function in Main and would depends only on ConsensusParams and the top CBlockIndex. Thanks to that, lots of consensus function currently in Main will not have any dependencies to CBlockIndex left.
Even if you don’t really agree on this plan, this commit add a “const” constraint in the passed CBlockIndex, and make the codebase more coherent. @jtimon, it will be usefull for your current libconsensus work as well.