Bitcoin Core 28.99.0
P2P Digital Currency
Classes | Typedefs | Functions | Variables
transaction.h File Reference
#include <attributes.h>
#include <consensus/amount.h>
#include <script/script.h>
#include <serialize.h>
#include <uint256.h>
#include <util/transaction_identifier.h>
#include <cstddef>
#include <cstdint>
#include <ios>
#include <limits>
#include <memory>
#include <numeric>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
Include dependency graph for transaction.h:

Go to the source code of this file.

Classes

class  COutPoint
 An outpoint - a combination of a transaction hash and an index n into its vout. More...
 
class  CTxIn
 An input of a transaction. More...
 
class  CTxOut
 An output of a transaction. More...
 
struct  TransactionSerParams
 
class  CTransaction
 The basic transaction that is broadcasted on the network and contained in blocks. More...
 
struct  CMutableTransaction
 A mutable version of CTransaction. More...
 
class  GenTxid
 A generic txid reference (txid or wtxid). More...
 

Typedefs

typedef std::shared_ptr< const CTransactionCTransactionRef
 

Functions

template<typename Stream , typename TxType >
void UnserializeTransaction (TxType &tx, Stream &s, const TransactionSerParams &params)
 Basic transaction serialization format: More...
 
template<typename Stream , typename TxType >
void SerializeTransaction (const TxType &tx, Stream &s, const TransactionSerParams &params)
 
template<typename TxType >
CAmount CalculateOutputValue (const TxType &tx)
 
template<typename Tx >
static CTransactionRef MakeTransactionRef (Tx &&txIn)
 

Variables

static constexpr TransactionSerParams TX_WITH_WITNESS {.allow_witness = true}
 
static constexpr TransactionSerParams TX_NO_WITNESS {.allow_witness = false}
 

Typedef Documentation

◆ CTransactionRef

typedef std::shared_ptr<const CTransaction> CTransactionRef

Definition at line 423 of file transaction.h.

Function Documentation

◆ CalculateOutputValue()

template<typename TxType >
CAmount CalculateOutputValue ( const TxType &  tx)
inline

Definition at line 286 of file transaction.h.

◆ MakeTransactionRef()

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

Definition at line 424 of file transaction.h.

◆ SerializeTransaction()

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

Definition at line 256 of file transaction.h.

Here is the caller graph for this function:

◆ UnserializeTransaction()

template<typename Stream , typename TxType >
void UnserializeTransaction ( TxType &  tx,
Stream &  s,
const TransactionSerParams params 
)

Basic transaction serialization format:

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

Extended transaction serialization format:

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

Definition at line 216 of file transaction.h.

Here is the caller graph for this function:

Variable Documentation

◆ TX_NO_WITNESS

constexpr TransactionSerParams TX_NO_WITNESS {.allow_witness = false}
staticconstexpr

Definition at line 196 of file transaction.h.

◆ TX_WITH_WITNESS

constexpr TransactionSerParams TX_WITH_WITNESS {.allow_witness = true}
staticconstexpr

Definition at line 195 of file transaction.h.