PIVX Core  5.6.99
P2P Digital Currency
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
CTransaction Class Reference

The basic transaction that is broadcasted on the network and contained in blocks. More...

#include <transaction.h>

Collaboration diagram for CTransaction:
[legend]

Public Types

enum  TxVersion : int16_t { LEGACY = 1 , SAPLING = 3 , TOOHIGH }
 Transaction Versions. More...
 
enum  TxType : int16_t {
  NORMAL = 0 , PROREG = 1 , PROUPSERV = 2 , PROUPREG = 3 ,
  PROUPREV = 4 , LLMQCOMM = 5
}
 Transaction types. More...
 

Public Member Functions

 CTransaction ()
 Construct a CTransaction that qualifies as IsNull() More...
 
 CTransaction (const CMutableTransaction &tx)
 Convert a CMutableTransaction into a CTransaction. More...
 
 CTransaction (CMutableTransaction &&tx)
 
 CTransaction (const CTransaction &tx)=default
 
template<typename Stream >
void Serialize (Stream &s) const
 
template<typename Stream >
 CTransaction (deserialize_type, Stream &s)
 This deserializing constructor is provided instead of an Unserialize method. More...
 
bool IsNull () const
 
const uint256GetHash () const
 
bool hasSaplingData () const
 
bool isSaplingVersion () const
 
bool IsShieldedTx () const
 
bool hasExtraPayload () const
 
bool IsSpecialTx () const
 
bool IsNormalType () const
 
bool IsProRegTx () const
 
bool IsQuorumCommitmentTx () const
 
SigVersion GetRequiredSigVersion () const
 
CAmount GetValueOut () const
 
CAmount GetShieldedValueIn () const
 
bool HasZerocoinSpendInputs () const
 
bool HasZerocoinMintOutputs () const
 
bool ContainsZerocoins () const
 
bool IsCoinBase () const
 
bool IsCoinStake () const
 
bool HasP2CSOutputs () const
 
bool HasExchangeAddr () const
 
unsigned int GetTotalSize () const
 
std::string ToString () const
 
size_t DynamicMemoryUsage () const
 

Public Attributes

std::vector< CTxInvin
 
std::vector< CTxOutvout
 
const int16_t nVersion
 
const int16_t nType
 
const uint32_t nLockTime
 
Optional< SaplingTxDatasapData {SaplingTxData()}
 
Optional< std::vector< uint8_t > > extraPayload {nullopt}
 

Static Public Attributes

static const int16_t CURRENT_VERSION = TxVersion::LEGACY
 

Private Member Functions

uint256 ComputeHash () const
 

Private Attributes

const uint256 hash
 Memory only. More...
 

Friends

bool operator== (const CTransaction &a, const CTransaction &b)
 
bool operator!= (const CTransaction &a, const CTransaction &b)
 

Detailed Description

The basic transaction that is broadcasted on the network and contained in blocks.

A transaction can contain multiple inputs and outputs.

Definition at line 243 of file transaction.h.

Member Enumeration Documentation

◆ TxType

enum CTransaction::TxType : int16_t

Transaction types.

Enumerator
NORMAL 
PROREG 
PROUPSERV 
PROUPREG 
PROUPREV 
LLMQCOMM 

Definition at line 254 of file transaction.h.

◆ TxVersion

enum CTransaction::TxVersion : int16_t

Transaction Versions.

Enumerator
LEGACY 
SAPLING 
TOOHIGH 

Definition at line 247 of file transaction.h.

Constructor & Destructor Documentation

◆ CTransaction() [1/5]

CTransaction::CTransaction ( )

Construct a CTransaction that qualifies as IsNull()

Definition at line 112 of file transaction.cpp.

◆ CTransaction() [2/5]

CTransaction::CTransaction ( const CMutableTransaction tx)

Convert a CMutableTransaction into a CTransaction.

Definition at line 113 of file transaction.cpp.

◆ CTransaction() [3/5]

CTransaction::CTransaction ( CMutableTransaction &&  tx)

Definition at line 114 of file transaction.cpp.

◆ CTransaction() [4/5]

CTransaction::CTransaction ( const CTransaction tx)
default

◆ CTransaction() [5/5]

template<typename Stream >
CTransaction::CTransaction ( deserialize_type  ,
Stream &  s 
)
inline

This deserializing constructor is provided instead of an Unserialize method.

Unserialize is not possible, since it would require overwriting const fields.

Definition at line 295 of file transaction.h.

Member Function Documentation

◆ ComputeHash()

uint256 CTransaction::ComputeHash ( ) const
private

Definition at line 101 of file transaction.cpp.

Here is the call graph for this function:

◆ ContainsZerocoins()

bool CTransaction::ContainsZerocoins ( ) const
inline

Definition at line 371 of file transaction.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DynamicMemoryUsage()

size_t CTransaction::DynamicMemoryUsage ( ) const

Definition at line 106 of file transaction.cpp.

◆ GetHash()

const uint256& CTransaction::GetHash ( ) const
inline

Definition at line 301 of file transaction.h.

Here is the caller graph for this function:

◆ GetRequiredSigVersion()

SigVersion CTransaction::GetRequiredSigVersion ( ) const
inline

Definition at line 347 of file transaction.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetShieldedValueIn()

CAmount CTransaction::GetShieldedValueIn ( ) const

Definition at line 187 of file transaction.cpp.

Here is the call graph for this function:

◆ GetTotalSize()

unsigned int CTransaction::GetTotalSize ( ) const

Definition at line 203 of file transaction.cpp.

Here is the call graph for this function:

◆ GetValueOut()

CAmount CTransaction::GetValueOut ( ) const

Definition at line 160 of file transaction.cpp.

Here is the call graph for this function:

◆ HasExchangeAddr()

bool CTransaction::HasExchangeAddr ( ) const

Definition at line 146 of file transaction.cpp.

◆ hasExtraPayload()

bool CTransaction::hasExtraPayload ( ) const
inline

Definition at line 324 of file transaction.h.

Here is the caller graph for this function:

◆ HasP2CSOutputs()

bool CTransaction::HasP2CSOutputs ( ) const

Definition at line 151 of file transaction.cpp.

◆ hasSaplingData()

bool CTransaction::hasSaplingData ( ) const
inline

Definition at line 305 of file transaction.h.

Here is the caller graph for this function:

◆ HasZerocoinMintOutputs()

bool CTransaction::HasZerocoinMintOutputs ( ) const

Definition at line 125 of file transaction.cpp.

Here is the caller graph for this function:

◆ HasZerocoinSpendInputs()

bool CTransaction::HasZerocoinSpendInputs ( ) const

Definition at line 116 of file transaction.cpp.

Here is the caller graph for this function:

◆ IsCoinBase()

bool CTransaction::IsCoinBase ( ) const
inline

Definition at line 376 of file transaction.h.

Here is the caller graph for this function:

◆ IsCoinStake()

bool CTransaction::IsCoinStake ( ) const

Definition at line 134 of file transaction.cpp.

Here is the caller graph for this function:

◆ IsNormalType()

bool CTransaction::IsNormalType ( ) const
inline

Definition at line 334 of file transaction.h.

◆ IsNull()

bool CTransaction::IsNull ( ) const
inline

Definition at line 297 of file transaction.h.

◆ IsProRegTx()

bool CTransaction::IsProRegTx ( ) const
inline

Definition at line 336 of file transaction.h.

Here is the call graph for this function:

◆ IsQuorumCommitmentTx()

bool CTransaction::IsQuorumCommitmentTx ( ) const
inline

Definition at line 341 of file transaction.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isSaplingVersion()

bool CTransaction::isSaplingVersion ( ) const
inline

Definition at line 314 of file transaction.h.

Here is the caller graph for this function:

◆ IsShieldedTx()

bool CTransaction::IsShieldedTx ( ) const
inline

Definition at line 319 of file transaction.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsSpecialTx()

bool CTransaction::IsSpecialTx ( ) const
inline

Definition at line 329 of file transaction.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Serialize()

template<typename Stream >
void CTransaction::Serialize ( Stream &  s) const
inline

Definition at line 288 of file transaction.h.

Here is the call graph for this function:

◆ ToString()

std::string CTransaction::ToString ( ) const

Definition at line 208 of file transaction.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator!=

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

Definition at line 390 of file transaction.h.

◆ operator==

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

Definition at line 385 of file transaction.h.

Member Data Documentation

◆ CURRENT_VERSION

const int16_t CTransaction::CURRENT_VERSION = TxVersion::LEGACY
static

Definition at line 263 of file transaction.h.

◆ extraPayload

Optional<std::vector<uint8_t> > CTransaction::extraPayload {nullopt}

Definition at line 276 of file transaction.h.

◆ hash

const uint256 CTransaction::hash
private

Memory only.

Definition at line 403 of file transaction.h.

◆ nLockTime

const uint32_t CTransaction::nLockTime

Definition at line 274 of file transaction.h.

◆ nType

const int16_t CTransaction::nType

Definition at line 273 of file transaction.h.

◆ nVersion

const int16_t CTransaction::nVersion

Definition at line 272 of file transaction.h.

◆ sapData

Optional<SaplingTxData> CTransaction::sapData {SaplingTxData()}

Definition at line 275 of file transaction.h.

◆ vin

std::vector<CTxIn> CTransaction::vin

Definition at line 270 of file transaction.h.

◆ vout

std::vector<CTxOut> CTransaction::vout

Definition at line 271 of file transaction.h.


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