Add Simplicity Deployment structure

This commit is contained in:
Russell O'Connor 2023-02-23 14:57:08 -05:00
parent 1698454c2a
commit bcd508f409
8 changed files with 53 additions and 4 deletions

View file

@ -1072,6 +1072,10 @@ bool MemPoolAccept::PolicyScriptChecks(const ATMPArgs& args, Workspace& ws)
scriptVerifyFlags |= SCRIPT_SIGHASH_RANGEPROOF;
}
if (DeploymentActiveAfter(m_active_chainstate.m_chain.Tip(), args.m_chainparams.GetConsensus(), Consensus::DEPLOYMENT_SIMPLICITY)) {
scriptVerifyFlags |= SCRIPT_VERIFY_SIMPLICITY;
}
// Check input scripts and signatures.
// This is done last to help prevent CPU exhaustion denial-of-service attacks.
if (!CheckInputScripts(tx, state, m_view, scriptVerifyFlags, true, false, ws.m_precomputed_txdata)) {
@ -2049,6 +2053,10 @@ static unsigned int GetBlockScriptFlags(const CBlockIndex* pindex, const Consens
flags |= SCRIPT_SIGHASH_RANGEPROOF;
}
if (DeploymentActiveAfter(pindex->pprev, consensusparams, Consensus::DEPLOYMENT_SIMPLICITY)) {
flags |= SCRIPT_VERIFY_SIMPLICITY;
}
return flags;
}