Skip to content

Commit

Permalink
Add SCRIPT_VERIFY_ANNEX deployment code
Browse files Browse the repository at this point in the history
  • Loading branch information
ariard committed Jan 17, 2023
1 parent 7c1d55f commit 4ccd693
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/consensus/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ enum DeploymentPos : uint16_t {
DEPLOYMENT_TESTDUMMY,
DEPLOYMENT_CHECKTEMPLATEVERIFY, // Deployment of CTV (BIP 119)
DEPLOYMENT_ANYPREVOUT,
DEPLOYMENT_ANNEX,
// NOTE: Also add new deployments to VersionBitsDeploymentInfo in deploymentinfo.cpp
MAX_VERSION_BITS_DEPLOYMENTS
};
Expand Down
3 changes: 2 additions & 1 deletion src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1659,9 +1659,10 @@ UniValue DeploymentInfo(const CBlockIndex* blockindex, const Consensus::Params&
SoftForkDescPushBack(blockindex, softforks, consensusParams, Consensus::DEPLOYMENT_TAPROOT);
SoftForkDescPushBack(blockindex, softforks, consensusParams, Consensus::DEPLOYMENT_CHECKTEMPLATEVERIFY);
SoftForkDescPushBack(blockindex, softforks, consensusParams, Consensus::DEPLOYMENT_ANYPREVOUT);
SoftForkDescPushBack(blockindex, softforks, consensusParams, Consensus::DEPLOYMENT_ANNEX);
return softforks;
}
} // anon namespace
}

static RPCHelpMan getdeploymentinfo()
{
Expand Down
5 changes: 5 additions & 0 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1872,6 +1872,11 @@ unsigned int GetBlockScriptFlags(const CBlockIndex* pindex, const Consensus::Par
flags |= SCRIPT_VERIFY_DEFAULT_CHECK_TEMPLATE_VERIFY_HASH;
}

// Enforce annex verification (BIPXXX)
if (DeploymentActiveAt(*pindex, consensusparams, Consensus::DEPLOYMENT_ANNEX)) {
flags |= SCRIPT_VERIFY_ANNEX;
}

return flags;
}

Expand Down

0 comments on commit 4ccd693

Please sign in to comment.