Merge pull request #1226 from OrfeasLitos/define-check-119

Define BIP-119 CheckDefaultCheckTemplateVerifyHash
This commit is contained in:
Luke Dashjr
2021-12-15 21:36:04 +00:00
committed by GitHub

View File

@ -167,6 +167,12 @@ specification for the semantics of OP_CHECKTEMPLATEVERIFY.
} }
break; break;
Where
bool CheckDefaultCheckTemplateVerifyHash(const std::vector<unsigned char>& hash) {
return GetDefaultCheckTemplateVerifyHash(current_tx, current_input_index) == uint256(hash);
}
The hash is computed as follows: The hash is computed as follows:
uint256 GetDefaultCheckTemplateVerifyHash(const CTransaction& tx, uint32_t input_index) { uint256 GetDefaultCheckTemplateVerifyHash(const CTransaction& tx, uint32_t input_index) {