Bitcoin Core  24.99.0
P2P Digital Currency
Classes | Typedefs | Functions | Variables
transaction.h File Reference
#include <consensus/amount.h>
#include <prevector.h>
#include <script/script.h>
#include <serialize.h>
#include <uint256.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...
 
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)
 Basic transaction serialization format: More...
 
template<typename Stream , typename TxType >
void SerializeTransaction (const TxType &tx, Stream &s)
 
template<typename TxType >
CAmount CalculateOutputValue (const TxType &tx)
 
template<typename Tx >
static CTransactionRef MakeTransactionRef (Tx &&txIn)
 

Variables

static const int SERIALIZE_TRANSACTION_NO_WITNESS = 0x40000000
 A flag that is ORed into the protocol version to designate that a transaction should be (un)serialized without witness data. More...
 

Typedef Documentation

◆ CTransactionRef

typedef std::shared_ptr<const CTransaction> CTransactionRef

Definition at line 421 of file transaction.h.

Function Documentation

◆ CalculateOutputValue()

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

Definition at line 285 of file transaction.h.

Here is the caller graph for this function:

◆ MakeTransactionRef()

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

Definition at line 422 of file transaction.h.

Here is the caller graph for this function:

◆ SerializeTransaction()

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

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 
)
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):
  • uint32_t nLockTime

Definition at line 217 of file transaction.h.

Here is the caller graph for this function:

Variable Documentation

◆ SERIALIZE_TRANSACTION_NO_WITNESS

const int SERIALIZE_TRANSACTION_NO_WITNESS = 0x40000000
static

A flag that is ORed into the protocol version to designate that a transaction should be (un)serialized without witness data.

Make sure that this does not collide with any of the values in version.h or with ADDRV2_FORMAT.

Definition at line 32 of file transaction.h.