Skip to main content

try_verify_p2pk_fast_path

Function try_verify_p2pk_fast_path 

Source
pub fn try_verify_p2pk_fast_path(
    script_sig: &Vec<u8>,
    script_pubkey: &[u8],
    flags: u32,
    tx: &Transaction,
    input_index: usize,
    prevout_values: &[i64],
    prevout_script_pubkeys: &[&[u8]],
    block_height: Option<u64>,
    network: Network,
    sighash_cache: Option<&Arc<Mutex<HashMap<SighashCacheKey, [u8; 32], FxBuildHasher>>>>,
) -> Option<Result<bool, ConsensusError>>
Expand description

VerifyScript with full context including block height, median time-past, and network

This version includes block height, median time-past, and network needed for proper BIP65 (CLTV), BIP112 (CSV), BIP66 (Strict DER), and BIP147 (NULLDUMMY) validation.

ยงArguments

  • block_height - Optional current block height (required for block-height CLTV, BIP66, BIP147)
  • median_time_past - Optional median time-past (required for timestamp CLTV per BIP113)
  • network - Network type (required for BIP66 and BIP147 activation heights) VerifyScript with full context - optimized version using parallel slices

This version accepts prevout values and script_pubkeys as separate slices to avoid unnecessary cloning of script_pubkey data. P2PK fast-path. Bare pay-to-pubkey: scriptPubKey is pubkey + OP_CHECKSIG, scriptSig is sig. Common in early blocks (coinbase outputs). Returns Some(Ok(bool)) if handled; None to fall back.