Before the first step #5696 (after creating an initial libconsensus and without counting checkpoints and Consensus::Params changes) gets negated (see #6526), here’s a little second step towards completing libconsensus. This is also part of #5970 process of explicitly passing chainparams around, and in that sense it replaces #6024.
The function declarations are adapted and moved to consensus/consensus.h Since we’re touching all declarations, it is diff-wise free to put them in the Consensus namespace at the same time. It also cherry picks one commit from #6526 (modified to rename CheckTransaction to Consensus::CheckTx [again, that rename is diff-wise free]).
The function definitions are left in main.cpp for now, but some of them will have to be moved to consensus/consensus.cpp before exposing anything else in libconsensus (my preference would be to expose VerifyHeader next, but I haven’t got much feedback in that reward).
Blocked by:
- Blocksize: Turn MAX_BLOCK_SIZE and MAX_BLOCK_SIGOPS into functions #6625