pub struct TxIn {
pub previous_output: OutPoint,
pub script_sig: Script,
pub sequence: Sequence,
pub witness: Witness,
}
Expand description
Bitcoin transaction input.
It contains the location of the previous transaction’s output, that it spends and set of scripts that satisfy its spending conditions.
Bitcoin Core References
Fields
previous_output: OutPoint
The reference to the previous output that is being used an an input.
script_sig: Script
The script which pushes values on the stack which will cause the referenced output’s script to be accepted.
sequence: Sequence
The sequence number, which suggests to miners which of two conflicting transactions should be preferred, or 0xFFFFFFFF to ignore this feature. This is generally never used since the miner behaviour cannot be enforced.
witness: Witness
Witness data: an array of byte-arrays. Note that this field is not (de)serialized with the rest of the TxIn in Encodable/Decodable, as it is (de)serialized at the end of the full Transaction. It is (de)serialized with the rest of the TxIn in other (de)serialization routines.
Implementations
sourceimpl TxIn
impl TxIn
sourcepub fn enables_lock_time(&self) -> bool
pub fn enables_lock_time(&self) -> bool
Returns true if this input enables the LockTime
(aka nLockTime
) of its Transaction
.
nLockTime
is enabled if any input enables it. See Transaction::is_lock_time_enabled
to check the overall state. If none of the inputs enables it, the lock time value is simply
ignored. If this returns false and OP_CHECKLOCKTIMEVERIFY is used in the redeem script with
this input then the script execution will fail [BIP-0065].
Trait Implementations
sourceimpl<'de> Deserialize<'de> for TxIn
impl<'de> Deserialize<'de> for TxIn
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
sourceimpl Ord for TxIn
impl Ord for TxIn
1.21.0 · sourceconst fn max(self, other: Self) -> Selfwhere
Self: Sized,
const fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 · sourceconst fn min(self, other: Self) -> Selfwhere
Self: Sized,
const fn min(self, other: Self) -> Selfwhere
Self: Sized,
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
sourceimpl PartialOrd<TxIn> for TxIn
impl PartialOrd<TxIn> for TxIn
sourcefn partial_cmp(&self, other: &TxIn) -> Option<Ordering>
fn partial_cmp(&self, other: &TxIn) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more