Bitcoin
Classes | Typedefs | Functions | Variables
transaction.h File Reference
#include <stdint.h>
#include <amount.h>
#include <script/script.h>
#include <serialize.h>
#include <uint256.h>

Go to the source code of this file.

Classes

class  COutPoint
 
class  CTxIn
 
class  CTxOut
 
class  CTransaction
 
struct  CMutableTransaction
 

Typedefs

typedef std::shared_ptr< const CTransactionCTransactionRef
 

Functions

template<typename Stream , typename TxType >
void UnserializeTransaction (TxType &tx, Stream &s)
 
template<typename Stream , typename TxType >
void SerializeTransaction (const TxType &tx, Stream &s)
 
static CTransactionRef MakeTransactionRef ()
 
template<typename Tx >
static CTransactionRef MakeTransactionRef (Tx &&txIn)
 

Variables

static const int SERIALIZE_TRANSACTION_NO_WITNESS = 0x40000000
 

Typedef Documentation

◆ CTransactionRef

typedef std::shared_ptr<const CTransaction> CTransactionRef

Function Documentation

◆ MakeTransactionRef() [1/2]

static CTransactionRef MakeTransactionRef ( )
inlinestatic

◆ MakeTransactionRef() [2/2]

template<typename Tx >
static CTransactionRef MakeTransactionRef ( Tx &&  txIn)
inlinestatic

◆ SerializeTransaction()

template<typename Stream , typename TxType >
void SerializeTransaction ( const TxType &  tx,
Stream &  s 
)
inline

◆ UnserializeTransaction()

template<typename Stream , typename TxType >
void UnserializeTransaction ( TxType &  tx,
Stream &  s 
)
inline

Basic transaction serialization format:

  • int32_t nVersion
  • std::vector<CTxIn> vin
  • std::vector<CTxOut> vout
  • uint32_t nLockTime

Extended transaction serialization format:

  • int32_t nVersion
  • unsigned char dummy = 0x00
  • unsigned char flags (!= 0)
  • std::vector<CTxIn> vin
  • std::vector<CTxOut> vout
  • if (flags & 1):
    • CTxWitness wit;
  • uint32_t nLockTime

Variable Documentation

◆ SERIALIZE_TRANSACTION_NO_WITNESS

const int SERIALIZE_TRANSACTION_NO_WITNESS = 0x40000000
static