Bitcoin Core 28.99.0
P2P Digital Currency
|
An input of a transaction. More...
#include <transaction.h>
Public Member Functions | |
CTxIn () | |
CTxIn (COutPoint prevoutIn, CScript scriptSigIn=CScript(), uint32_t nSequenceIn=SEQUENCE_FINAL) | |
CTxIn (Txid hashPrevTx, uint32_t nOut, CScript scriptSigIn=CScript(), uint32_t nSequenceIn=SEQUENCE_FINAL) | |
SERIALIZE_METHODS (CTxIn, obj) | |
std::string | ToString () const |
Public Attributes | |
COutPoint | prevout |
CScript | scriptSig |
uint32_t | nSequence |
CScriptWitness | scriptWitness |
Only serialized through CTransaction. More... | |
Static Public Attributes | |
static const uint32_t | SEQUENCE_FINAL = 0xffffffff |
Setting nSequence to this value for every input in a transaction disables nLockTime/IsFinalTx(). More... | |
static const uint32_t | MAX_SEQUENCE_NONFINAL {SEQUENCE_FINAL - 1} |
This is the maximum sequence number that enables both nLockTime and OP_CHECKLOCKTIMEVERIFY (BIP 65). More... | |
static const uint32_t | SEQUENCE_LOCKTIME_DISABLE_FLAG = (1U << 31) |
If this flag is set, CTxIn::nSequence is NOT interpreted as a relative lock-time. More... | |
static const uint32_t | SEQUENCE_LOCKTIME_TYPE_FLAG = (1 << 22) |
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. More... | |
static const uint32_t | SEQUENCE_LOCKTIME_MASK = 0x0000ffff |
If CTxIn::nSequence encodes a relative lock-time, this mask is applied to extract that lock-time from the sequence field. More... | |
static const int | SEQUENCE_LOCKTIME_GRANULARITY = 9 |
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. More... | |
Friends | |
bool | operator== (const CTxIn &a, const CTxIn &b) |
bool | operator!= (const CTxIn &a, const CTxIn &b) |
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.
Definition at line 66 of file transaction.h.
|
inline |
Definition at line 121 of file transaction.h.
|
explicit |
Definition at line 26 of file transaction.cpp.
CTxIn::CTxIn | ( | Txid | hashPrevTx, |
uint32_t | nOut, | ||
CScript | scriptSigIn = CScript() , |
||
uint32_t | nSequenceIn = SEQUENCE_FINAL |
||
) |
Definition at line 33 of file transaction.cpp.
|
inline |
Definition at line 129 of file transaction.h.
std::string CTxIn::ToString | ( | ) | const |
Definition at line 40 of file transaction.cpp.
Definition at line 138 of file transaction.h.
Definition at line 131 of file transaction.h.
|
static |
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).
Definition at line 87 of file transaction.h.
uint32_t CTxIn::nSequence |
Definition at line 71 of file transaction.h.
COutPoint CTxIn::prevout |
Definition at line 69 of file transaction.h.
CScript CTxIn::scriptSig |
Definition at line 70 of file transaction.h.
CScriptWitness CTxIn::scriptWitness |
Only serialized through CTransaction.
Definition at line 72 of file transaction.h.
|
static |
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).
Definition at line 81 of file transaction.h.
|
static |
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).
Definition at line 98 of file transaction.h.
|
static |
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.
Definition at line 119 of file transaction.h.
|
static |
If CTxIn::nSequence encodes a relative lock-time, this mask is applied to extract that lock-time from the sequence field.
Definition at line 109 of file transaction.h.
|
static |
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.
Definition at line 104 of file transaction.h.