Validate RandomX proof of work when reading blocks

This commit is contained in:
Capri 2026-09-15 22:06:59 +00:00
commit e9e4cad8e8
Signed by: VextaProject
SSH key fingerprint: SHA256:739BZv8LvIDY2tR7lXLy/IQ6MaGTQtYcG9GNvCjmpVM
3 changed files with 35 additions and 11 deletions

View file

@ -346,6 +346,14 @@ void InitScriptExecutionCache();
/** Context-independent validity checks */
bool CheckBlock(const CBlock& block, BlockValidationState& state, const Consensus::Params& consensusParams, bool fCheckPOW = true, bool fCheckMerkleRoot = true);
/** Context-dependent RandomX proof-of-work validation. */
bool CheckContextualRandomXProofOfWork(
const CBlockHeader& block,
BlockValidationState& state,
const Consensus::Params& consensusParams,
const CBlockIndex* pindexPrev,
bool fCheckPOW = true);
/** Check a block is completely valid from start to finish (only works on top of our current best block) */
bool TestBlockValidity(BlockValidationState& state,
const CChainParams& chainparams,