Dash Core  0.12.2.1
P2P Digital Currency
CTransaction Class Reference

#include <transaction.h>

+ Inheritance diagram for CTransaction:

Public Member Functions

 CTransaction ()
 
 CTransaction (const CMutableTransaction &tx)
 
CTransactionoperator= (const CTransaction &tx)
 
template<typename Stream , typename Operation >
void SerializationOp (Stream &s, Operation ser_action, int nType, int nVersion)
 
bool IsNull () const
 
const uint256GetHash () const
 
CAmount GetValueOut () const
 
double ComputePriority (double dPriorityInputs, unsigned int nTxSize=0) const
 
unsigned int CalculateModifiedSize (unsigned int nTxSize=0) const
 
unsigned int GetTotalSize () const
 
bool IsCoinBase () const
 
std::string ToString () const
 

Public Attributes

const int32_t nVersion
 
const std::vector< CTxInvin
 
const std::vector< CTxOutvout
 
const uint32_t nLockTime
 
 ADD_SERIALIZE_METHODS
 

Static Public Attributes

static const int32_t CURRENT_VERSION =1
 
static const int32_t MAX_STANDARD_VERSION =2
 

Private Member Functions

void UpdateHash () const
 

Private Attributes

const uint256 hash
 

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

Constructor & Destructor Documentation

◆ CTransaction() [1/2]

CTransaction::CTransaction ( )

Construct a CTransaction that qualifies as IsNull()

Definition at line 97 of file transaction.cpp.

◆ CTransaction() [2/2]

CTransaction::CTransaction ( const CMutableTransaction tx)

Convert a CMutableTransaction into a CTransaction.

Definition at line 99 of file transaction.cpp.

Member Function Documentation

◆ CalculateModifiedSize()

unsigned int CTransaction::CalculateModifiedSize ( unsigned int  nTxSize = 0) const

Definition at line 132 of file transaction.cpp.

Referenced by ComputePriority(), and CTxMemPoolEntry::CTxMemPoolEntry().

◆ ComputePriority()

double CTransaction::ComputePriority ( double  dPriorityInputs,
unsigned int  nTxSize = 0 
) const

Definition at line 124 of file transaction.cpp.

Referenced by CWallet::CreateTransaction(), and CCoinsViewCache::GetPriority().

◆ GetHash()

const uint256& CTransaction::GetHash ( ) const
inline

Definition at line 262 of file transaction.h.

Referenced by CInstantSend::AcceptLockRequest(), AcceptToMemoryPool(), AcceptToMemoryPoolWorker(), CTxMemPool::addAddressIndex(), CPrivateSend::AddDSTX(), CTxMemPool::addSpentIndex(), CWallet::AddToWallet(), CWallet::AddToWalletIfInvolvingMe(), AppInit2(), blockToJSON(), CheckBlock(), CDarksendBroadcastTx::CheckSignature(), CPrivateSendServer::CommitFinalTransaction(), CWallet::CommitTransaction(), ConnectBlock(), CPrivateSendClient::CreateDenominated(), CreateNewBlock(), CInstantSend::CreateTxLockCandidate(), TransactionRecord::decomposeTransaction(), DisconnectBlock(), DisconnectTip(), TransactionDesc::FormatTxStatus(), getblocktemplate(), CTxLockCandidate::GetHash(), GetTransaction(), gettxoutproof(), gobject(), CInstantSend::IsEnoughOrphanVotesForTx(), IsRBFOptIn(), CBloomFilter::IsRelevantAndUpdate(), CTxLockRequest::IsValid(), ListReceived(), CPrivateSendClient::MakeCollateralAmounts(), mempoolToJSON(), CZMQPublishHashTransactionNotifier::NotifyTransaction(), CZMQPublishRawTransactionNotifier::NotifyTransaction(), CZMQPublishHashTransactionLockNotifier::NotifyTransactionLock(), CZMQPublishRawTransactionLockNotifier::NotifyTransactionLock(), mempoolentry_txid::operator()(), CompareTxMemPoolEntryByScore::operator()(), OutputTxHash(), ProcessMessage(), CBlockPolicyEstimator::processTransaction(), CInstantSend::ProcessTxLockRequest(), CWallet::ReacceptWalletTransactions(), CInstantSend::RejectLockRequest(), CConnman::RelayTransaction(), CTxMemPool::remove(), CTxMemPool::removeConflicts(), CTxMemPool::removeForBlock(), CWalletDB::ReorderTransactions(), CWallet::ResendWalletTransactionsBefore(), sendfrom(), sendmany(), sendrawtransaction(), CDarksendBroadcastTx::Sign(), CPrivateSendClient::SignFinalTransaction(), CInstantSend::SyncTransaction(), CPrivateSend::SyncTransaction(), TransactionDesc::toHTML(), ToString(), CInstantSend::TryToFinalizeLockCandidate(), TxToJSON(), TxToUniv(), UpdateCoins(), and WalletTxToJSON().

◆ GetTotalSize()

unsigned int CTransaction::GetTotalSize ( ) const

Get the total transaction size in bytes, including witness data. "Total Size" defined in BIP141 and BIP144.

Returns
Total transaction size in bytes

Definition at line 150 of file transaction.cpp.

Referenced by TransactionDesc::toHTML().

◆ GetValueOut()

◆ IsCoinBase()

◆ IsNull()

bool CTransaction::IsNull ( ) const
inline

Definition at line 258 of file transaction.h.

◆ operator=()

CTransaction & CTransaction::operator= ( const CTransaction tx)

Definition at line 103 of file transaction.cpp.

◆ SerializationOp()

template<typename Stream , typename Operation >
void CTransaction::SerializationOp ( Stream &  s,
Operation  ser_action,
int  nType,
int  nVersion 
)
inline

Definition at line 248 of file transaction.h.

◆ ToString()

◆ UpdateHash()

void CTransaction::UpdateHash ( ) const
private

Definition at line 92 of file transaction.cpp.

Referenced by CTransaction(), and SerializationOp().

Friends And Related Function Documentation

◆ operator!=

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

Definition at line 294 of file transaction.h.

◆ operator==

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

Definition at line 289 of file transaction.h.

Member Data Documentation

◆ ADD_SERIALIZE_METHODS

CTransaction::ADD_SERIALIZE_METHODS

Definition at line 245 of file transaction.h.

◆ CURRENT_VERSION

const int32_t CTransaction::CURRENT_VERSION =1
static

Definition at line 219 of file transaction.h.

Referenced by AddOrphanTx(), IsStandardTx(), and MutateTxVersion().

◆ hash

const uint256 CTransaction::hash
private

Memory only.

Definition at line 214 of file transaction.h.

Referenced by GetHash(), operator=(), and UpdateHash().

◆ MAX_STANDARD_VERSION

const int32_t CTransaction::MAX_STANDARD_VERSION =2
static

Definition at line 225 of file transaction.h.

Referenced by IsStandardTx().

◆ nLockTime

◆ nVersion

◆ vin

const std::vector<CTxIn> CTransaction::vin

Definition at line 233 of file transaction.h.

Referenced by AcceptToMemoryPoolWorker(), CTxMemPool::addAddressIndex(), CTxMemPool::addSpentIndex(), CWallet::AddToWallet(), CWallet::AddToWalletIfInvolvingMe(), CTxMemPool::addUnchecked(), AreInputsStandard(), CTxMemPool::CalculateMemPoolAncestors(), CalculateModifiedSize(), CalculateSequenceLocks(), CTxMemPool::check(), CheckBlock(), CheckInputs(), TransactionSignatureChecker::CheckLockTime(), TransactionSignatureChecker::CheckSequence(), CheckSequenceLocks(), CheckTransaction(), Consensus::CheckTxInputs(), CWallet::CommitTransaction(), ConnectBlock(), CInstantSend::CreateTxLockCandidate(), TransactionRecord::decomposeTransaction(), DisconnectBlock(), CWallet::FundTransaction(), CWallet::GetAddressGroupings(), getblocktemplate(), CWallet::GetConflicts(), CWallet::GetDebit(), GetLegacySigOpCount(), CTxLockRequest::GetMaxSignatures(), CTxLockRequest::GetMinFee(), GetP2SHSigOpCount(), CCoinsViewCache::GetPriority(), CWallet::GetRealOutpointPrivateSendRounds(), CCoinsViewCache::GetValueIn(), CTxMemPool::HasNoInputsOf(), CCoinsViewCache::HaveInputs(), IsCoinBase(), CPrivateSend::IsCollateralValid(), CInstantSend::IsEnoughOrphanVotesForTx(), IsFinalTx(), IsNull(), CBloomFilter::IsRelevantAndUpdate(), IsStandardTx(), CTxLockRequest::IsValid(), WalletModel::listCoins(), mempoolToJSON(), MutateTxSign(), operator=(), WalletModel::prepareTransaction(), CInstantSend::ProcessTxLockRequest(), RecursiveDynamicUsage(), CTxMemPool::removeConflicts(), CTxMemPool::removeForReorg(), CInstantSend::ResolveConflicts(), SerializationOp(), SignalsOptInRBF(), SignatureHash(), CWallet::SyncTransaction(), TransactionDesc::toHTML(), ToString(), CTxMemPool::TrimToSize(), TxToJSON(), TxToUniv(), and UpdateCoins().

◆ vout


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