Skip to main content

calculate_transaction_sighash_with_script_code

Function calculate_transaction_sighash_with_script_code 

Source
pub fn calculate_transaction_sighash_with_script_code(
    tx: &Transaction,
    input_index: usize,
    prevout_values: &[i64],
    prevout_script_pubkeys: &[&[u8]],
    sighash_type: SighashType,
    script_code: Option<&[u8]>,
    sighash_cache: Option<&Arc<Mutex<HashMap<SighashCacheKey, [u8; 32], FxBuildHasher>>>>,
) -> Result<[u8; 32], ConsensusError>
Expand description

Calculate transaction sighash with optional script code override

For P2SH transactions, script_code should be the redeem script (not the scriptPubKey). For non-P2SH, script_code should be None (uses scriptPubKey from prevout). When sighash_cache is provided (parallel script-check path), caches (scriptCode, sighash_byte) -> hash for multisig reuse.