An input of a transaction. It contains the location of the previous transaction's output that it claims and a signature that matches the output's public key.
Synopsis
Declared in <primitives/transaction.h>
class CTxIn;
Member Functions
Data Members
Name |
Description |
Sequence number, used for relative lock‐times and replaceability. |
|
The previous output being spent by this input. |
|
Script that satisfies the spending conditions of the previous output. |
|
Only serialized through CTransaction |
Static Data Members
Name |
Description |
This is the maximum sequence number that enables both nLockTime and OP_CHECKLOCKTIMEVERIFY (BIP 65). It has SEQUENCE_LOCKTIME_DISABLE_FLAG set (BIP 68/112). |
|
Setting nSequence to this value for every input in a transaction disables nLockTime/IsFinalTx(). It fails OP_CHECKLOCKTIMEVERIFY/CheckLockTime() for any input that has it set (BIP 65). It has SEQUENCE_LOCKTIME_DISABLE_FLAG set (BIP 68/112). |
|
If this flag is set, CTxIn::nSequence is NOT interpreted as a relative lock‐time. It skips SequenceLocks() for any input that has it set (BIP 68). It fails OP_CHECKSEQUENCEVERIFY/CheckSequence() for any input that has it set (BIP 112). |
|
In order to use the same number of bits to encode roughly the same wall‐clock duration, and because blocks are naturally limited to occur every 600s on average, the minimum granularity for time‐based relative lock‐time is fixed at 512 seconds. Converting from CTxIn::nSequence to seconds is performed by multiplying by 512 = 2ˆ9, or equivalently shifting up by 9 bits. |
|
If CTxIn::nSequence encodes a relative lock‐time, this mask is applied to extract that lock‐time from the sequence field. |
|
If CTxIn::nSequence encodes a relative lock‐time and this flag is set, the relative lock‐time has units of 512 seconds, otherwise it specifies blocks with a granularity of 1. |
Friends
Name |
Description |
Compares two inputs for equality. |
Non-Member Functions
Name |
Description |
Compute the virtual size of a single transaction input. |
|
Write the scriptSig and witness from signature data back into an input. |
Created with MrDocs