Bitcoin ABC  0.22.15
P2P Digital Currency
Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
CTxIn Class Reference

An input of a transaction. More...

#include <transaction.h>

Collaboration diagram for CTxIn:
[legend]

Public Member Functions

 CTxIn ()
 
 CTxIn (COutPoint prevoutIn, CScript scriptSigIn=CScript(), uint32_t nSequenceIn=SEQUENCE_FINAL)
 
 CTxIn (TxId prevTxId, 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
 

Static Public Attributes

static const uint32_t SEQUENCE_FINAL = 0xffffffff
 Setting nSequence to this value for every input in a transaction disables nLockTime. More...
 
static const uint32_t SEQUENCE_LOCKTIME_DISABLE_FLAG = (1U << 31)
 If this flag 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)
 

Detailed Description

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 61 of file transaction.h.

Constructor & Destructor Documentation

◆ CTxIn() [1/3]

CTxIn::CTxIn ( )
inline

Definition at line 103 of file transaction.h.

◆ CTxIn() [2/3]

CTxIn::CTxIn ( COutPoint  prevoutIn,
CScript  scriptSigIn = CScript(),
uint32_t  nSequenceIn = SEQUENCE_FINAL 
)
inlineexplicit

Definition at line 105 of file transaction.h.

◆ CTxIn() [3/3]

CTxIn::CTxIn ( TxId  prevTxId,
uint32_t  nOut,
CScript  scriptSigIn = CScript(),
uint32_t  nSequenceIn = SEQUENCE_FINAL 
)
inline

Definition at line 108 of file transaction.h.

Member Function Documentation

◆ SERIALIZE_METHODS()

CTxIn::SERIALIZE_METHODS ( CTxIn  ,
obj   
)
inline

Definition at line 112 of file transaction.h.

◆ ToString()

std::string CTxIn::ToString ( ) const

Definition at line 16 of file transaction.cpp.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const CTxIn a,
const CTxIn b 
)
friend

Definition at line 121 of file transaction.h.

◆ operator==

bool operator== ( const CTxIn a,
const CTxIn b 
)
friend

Definition at line 116 of file transaction.h.

Member Data Documentation

◆ nSequence

uint32_t CTxIn::nSequence

Definition at line 65 of file transaction.h.

◆ prevout

COutPoint CTxIn::prevout

Definition at line 63 of file transaction.h.

◆ scriptSig

CScript CTxIn::scriptSig

Definition at line 64 of file transaction.h.

◆ SEQUENCE_FINAL

const uint32_t CTxIn::SEQUENCE_FINAL = 0xffffffff
static

Setting nSequence to this value for every input in a transaction disables nLockTime.

Definition at line 71 of file transaction.h.

◆ SEQUENCE_LOCKTIME_DISABLE_FLAG

const uint32_t CTxIn::SEQUENCE_LOCKTIME_DISABLE_FLAG = (1U << 31)
static

If this flag set, CTxIn::nSequence is NOT interpreted as a relative lock-time.

Definition at line 78 of file transaction.h.

◆ SEQUENCE_LOCKTIME_GRANULARITY

const int CTxIn::SEQUENCE_LOCKTIME_GRANULARITY = 9
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 101 of file transaction.h.

◆ SEQUENCE_LOCKTIME_MASK

const uint32_t CTxIn::SEQUENCE_LOCKTIME_MASK = 0x0000ffff
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 91 of file transaction.h.

◆ SEQUENCE_LOCKTIME_TYPE_FLAG

const uint32_t CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG = (1 << 22)
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 85 of file transaction.h.


The documentation for this class was generated from the following files: