A simple refactor as preparation for moving consensus to code for transaction validation.
Consensus shouldn't depend on std::vector<CScriptCheck> *pvChecks.
This is part of #6051 but can be merged independently.
Code change looks good to me, but why is CheckInputs not consensus, while CheckTxInputs is?
CheckInputs uses the CScriptCheck class which consensus doesn't need. I later plan to create Consensus::CheckTxInputsScripts that does the remaining and it's used directly instead of CheckInputs in some places (in miner and AcceptToMemPool, but not in AcceptBlock). The following branch is outdated, but you can get an idea here https://github.com/jtimon/bitcoin/commit/ddd505a4f62603d6b2ed07e0fecb213b81c8f795
506 | @@ -507,4 +507,10 @@ extern CCoinsViewCache *pcoinsTip; 507 | /** Global variable that points to the active block tree (protected by cs_main) */ 508 | extern CBlockTreeDB *pblocktree; 509 | 510 | +/** 511 | + * While checking, GetBestBlock() refers to the parent block. (protected by cs_main)
This comment does not actually describe what the function does :)
Yeah, I just moved the comments from the cpp instead of moving the implementation of the new function. I've just added a line to the doc. Should I leave the rest here or move it back to the implementation?
ACK