TransactionChecker

Struct TransactionChecker 

Source
pub struct TransactionChecker<'a> {
    pub tx: &'a Tx,
    pub sig_hash_cache: &'a mut SigHashCache,
    pub input: usize,
    pub amount: Amount,
    pub require_sighash_forkid: bool,
}
Expand description

Checks that external values in a script are correct for a specific transaction spend

Fields§

§tx: &'a Tx

Spending transaction

§sig_hash_cache: &'a mut SigHashCache

Cache for intermediate sighash values

§input: usize

Spending input for the script

§amount: Amount

Amount being spent

§require_sighash_forkid: bool

True if the signature must have SIGHASH_FORKID present, false if not

Trait Implementations§

Source§

impl<'a> Checker for TransactionChecker<'a>

Source§

fn check_sig( &mut self, sig: &[u8], pubkey: &[u8], script: &[u8], ) -> Result<bool>

Checks that a signature and public key validate within a script Read more
Source§

fn check_locktime(&self, locktime: i32) -> Result<bool>

Checks that the lock time is valid according to BIP 65
Source§

fn check_sequence(&self, sequence: i32) -> Result<bool>

Checks that the relative lock time enforced by the sequence is valid according to BIP 112

Auto Trait Implementations§

§

impl<'a> Freeze for TransactionChecker<'a>

§

impl<'a> RefUnwindSafe for TransactionChecker<'a>

§

impl<'a> Send for TransactionChecker<'a>

§

impl<'a> Sync for TransactionChecker<'a>

§

impl<'a> Unpin for TransactionChecker<'a>

§

impl<'a> !UnwindSafe for TransactionChecker<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.