pub fn verify(
script_pubkey: &impl ScriptPubkeyExt,
amount: Option<i64>,
tx_to: &impl TransactionExt,
input_index: usize,
flags: Option<u32>,
spent_outputs: &[impl TxOutExt],
) -> Result<(), KernelError>
Expand description
Verifies a transaction input against its corresponding output script.
§Arguments
script_pubkey
- The output script to verify againstamount
- Needs to be set if the segwit flag is settx_to
- The transaction containing the input to verifyinput_index
- The index of the input withintx_to
to verifyflags
- Defaults to all if nonespent_output
- The outputs being spent by this transaction
§Returns
Ok(())
if verification succeedsKernelError::ScriptVerify
an error describing the failure