pub(crate) fn sighash(
precomputed_tx_data: &PrecomputedTxData,
hash_type: HashType,
input_index_script_code: Option<(usize, Vec<u8>)>,
) -> SigHashExpand description
Compute a signature hash using librustzcash.
§Inputs
precomputed_tx_data: precomputed data for the transaction whose signature hash is being computed.hash_type: the type of hash (SIGHASH) being used.input_index_script_code: a tuple with the index of the transparent Input for which we are producing a sighash and the respective script code being validated, or None if it’s a shielded input.
§Panics
- if
input_index_script_codeisSome((input_index, _))andinput_indexis out of bounds forprecomputed_tx_data.all_previous_outputs. The public callers inzebra-chaindocument this as a precondition. - if the previous output at
input_indexhas a value that cannot be converted toZatoshis. Output values are validated before sighash computation, so this branch is unreachable in practice.