Skip to main content

validate_template_hash

Function validate_template_hash 

Source
pub fn validate_template_hash(
    tx: &Transaction,
    input_index: usize,
    expected_hash: &[u8],
) -> Result<bool, ConsensusError>
Expand description

Validate template hash for CTV

Checks if the provided template hash matches the transaction’s template hash.

§Arguments

  • tx - The transaction to validate
  • input_index - The index of the input being verified
  • expected_hash - The expected template hash (32 bytes)

§Returns

true if template hash matches, false otherwise