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 Jun 18, 2023
1 parent b982a1a commit 645dbf2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/consensus/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,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
1 change: 1 addition & 0 deletions src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,7 @@ UniValue DeploymentInfo(const CBlockIndex* blockindex, const ChainstateManager&
SoftForkDescPushBack(blockindex, softforks, chainman, Consensus::DEPLOYMENT_TAPROOT);
SoftForkDescPushBack(blockindex, softforks, chainman, Consensus::DEPLOYMENT_CHECKTEMPLATEVERIFY);
SoftForkDescPushBack(blockindex, softforks, chainman, Consensus::DEPLOYMENT_ANYPREVOUT);
SoftForkDescPushBack(blockindex, softforks, chainman, Consensus::DEPLOYMENT_ANNEX);
return softforks;
}
} // anon namespace
Expand Down
5 changes: 5 additions & 0 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1932,6 +1932,11 @@ unsigned int GetBlockScriptFlags(const CBlockIndex& block_index, const Chainstat
flags |= SCRIPT_VERIFY_ANYPREVOUT;
}

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

return flags;
}

Expand Down

0 comments on commit 645dbf2

Please sign in to comment.