Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
The basic transaction that is broadcasted on the network and contained in blocks. More...
#include <transaction.h>
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) | |
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 uint256 & | GetHash () const |
CAmount | GetValueOut () const |
unsigned int | GetTotalSize () const |
Get the total transaction size in bytes, including witness data. More... | |
bool | IsCoinBase () const |
std::string | ToString () const |
Public Attributes | |
const std::vector< CTxIn > | vin |
const std::vector< CTxOut > | vout |
const int16_t | nVersion |
const int16_t | nType |
const uint32_t | nLockTime |
const std::vector< uint8_t > | vExtraPayload |
Static Public Attributes | |
static const int32_t | CURRENT_VERSION =2 |
static const int32_t | MAX_STANDARD_VERSION =3 |
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 198 of file transaction.h.
Constructor & Destructor Documentation
◆ CTransaction() [1/4]
CTransaction::CTransaction | ( | ) |
Construct a CTransaction that qualifies as IsNull()
Definition at line 95 of file transaction.cpp.
◆ CTransaction() [2/4]
CTransaction::CTransaction | ( | const CMutableTransaction & | tx | ) |
Convert a CMutableTransaction into a CTransaction.
Definition at line 96 of file transaction.cpp.
◆ CTransaction() [3/4]
CTransaction::CTransaction | ( | CMutableTransaction && | tx | ) |
Definition at line 97 of file transaction.cpp.
◆ CTransaction() [4/4]
|
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 250 of file transaction.h.
Member Function Documentation
◆ ComputeHash()
|
private |
Definition at line 89 of file transaction.cpp.
References SerializeHash().
◆ GetHash()
|
inline |
Definition at line 256 of file transaction.h.
References hash.
Referenced by AcceptToMemoryPoolWorker(), CTxMemPool::addAddressIndex(), AddCoins(), CTxMemPool::addSpentIndex(), CWallet::AddToWalletIfInvolvingMe(), AddTx(), CTxMemPool::addUnchecked(), PeerLogicValidation::BlockConnected(), CDeterministicMNManager::BuildNewListFromBlock(), CBlockHeaderAndShortTxIDs::CBlockHeaderAndShortTxIDs(), llmq::CInstantSendManager::CheckCanLock(), CheckInputs(), CheckProRegTx(), CBloomFilter::CheckSpecialTransactionMatchesAndUpdate(), CChainState::ConnectBlock(), CChainState::DisconnectBlock(), entryToJSON(), getblocktemplate(), llmq::CInstantSendManager::GetConflictingLock(), getmempoolancestors(), getmempooldescendants(), CBloomFilter::IsRelevantAndUpdate(), mempoolToJSON(), CZMQPublishHashInstantSendDoubleSpendNotifier::NotifyInstantSendDoubleSpendAttempt(), CZMQPublishRawInstantSendDoubleSpendNotifier::NotifyInstantSendDoubleSpendAttempt(), CZMQPublishHashTransactionNotifier::NotifyTransaction(), CZMQPublishRawTransactionNotifier::NotifyTransaction(), CZMQPublishHashTransactionLockNotifier::NotifyTransactionLock(), CZMQPublishRawTransactionLockNotifier::NotifyTransactionLock(), CZMQPublishRawTransactionLockSigNotifier::NotifyTransactionLock(), CWallet::NotifyTransactionLock(), mempoolentry_txid::operator()(), CompareTxMemPoolEntryByScore::operator()(), OutputTxHash(), CBlockPolicyEstimator::processBlockTx(), ProcessMessage(), CBlockPolicyEstimator::processTransaction(), llmq::CInstantSendManager::ProcessTx(), CConnman::RelayTransaction(), llmq::CInstantSendManager::RemoveConflictedTx(), CTxMemPool::removeConflicts(), CTxMemPool::removeProTxCollateralConflicts(), CTxMemPool::removeProTxConflicts(), CTxMemPool::removeProTxPubKeyConflicts(), CTxMemPool::removeRecursive(), CPrivateSendClientSession::SignFinalTransaction(), ToString(), llmq::CInstantSendManager::TrySignInstantSendLock(), TxToJSON(), and TxToUniv().
◆ 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 110 of file transaction.cpp.
References GetSerializeSize(), PROTOCOL_VERSION, and SER_NETWORK.
◆ GetValueOut()
CAmount CTransaction::GetValueOut | ( | ) | const |
Definition at line 99 of file transaction.cpp.
References MoneyRange(), and vout.
Referenced by Consensus::CheckTxInputs(), and CSuperblock::IsValid().
◆ IsCoinBase()
|
inline |
Definition at line 272 of file transaction.h.
References vin.
Referenced by AcceptToMemoryPoolWorker(), AddCoins(), AreInputsStandard(), CheckCbTx(), CheckInputs(), CheckInputsAndUpdateCoins(), CheckInputsFromMempoolAndCache(), CheckTransaction(), CChainState::ConnectBlock(), ContextualCheckTransaction(), CChainState::DisconnectBlock(), getblocktemplate(), GetP2SHSigOpCount(), GetTransactionSigOpCount(), CCoinsViewCache::GetValueIn(), CCoinsViewCache::HaveInputs(), TxToJSON(), TxToUniv(), and UpdateCoins().
◆ IsNull()
|
inline |
Definition at line 252 of file transaction.h.
◆ Serialize()
|
inline |
Definition at line 237 of file transaction.h.
References nLockTime, TRANSACTION_NORMAL, vExtraPayload, vin, and vout.
◆ ToString()
std::string CTransaction::ToString | ( | ) | const |
Definition at line 115 of file transaction.cpp.
References GetHash(), nLockTime, nType, nVersion, strprintf, vExtraPayload, vin, and vout.
Referenced by CTxMemPool::existsProviderTxConflict(), IsBlockPayeeValid(), CPrivateSend::IsCollateralValid(), CPrivateSendClientSession::ProcessMessage(), and CTxMemPool::removeProTxConflicts().
Friends And Related Function Documentation
◆ operator!=
|
friend |
Definition at line 282 of file transaction.h.
◆ operator==
|
friend |
Definition at line 277 of file transaction.h.
Member Data Documentation
◆ CURRENT_VERSION
|
static |
Definition at line 202 of file transaction.h.
Referenced by AddOrphanTx(), and IsStandardTx().
◆ hash
|
private |
◆ MAX_STANDARD_VERSION
|
static |
Definition at line 208 of file transaction.h.
Referenced by IsStandardTx(), and MutateTxVersion().
◆ nLockTime
const uint32_t CTransaction::nLockTime |
Definition at line 219 of file transaction.h.
Referenced by TransactionSignatureChecker::CheckLockTime(), CPrivateSend::IsCollateralValid(), IsFinalTx(), Serialize(), ToString(), and TxToUniv().
◆ nType
const int16_t CTransaction::nType |
Definition at line 218 of file transaction.h.
Referenced by AcceptToMemoryPoolWorker(), CTxMemPool::addUnchecked(), CDeterministicMNManager::BuildNewListFromBlock(), CheckCbTx(), CheckProRegTx(), CheckProUpRegTx(), CheckProUpRevTx(), CheckProUpServTx(), CBloomFilter::CheckSpecialTransactionMatchesAndUpdate(), CheckSpecialTx(), CheckTransaction(), ContextualCheckTransaction(), CTxMemPool::existsProviderTxConflict(), ProcessSpecialTx(), CTxMemPool::removeProTxConflicts(), ToString(), TxToUniv(), and UndoSpecialTx().
◆ nVersion
const int16_t CTransaction::nVersion |
Definition at line 217 of file transaction.h.
Referenced by AcceptToMemoryPoolWorker(), CDeterministicMNManager::BuildNewListFromBlock(), CalculateSequenceLocks(), TransactionSignatureChecker::CheckSequence(), CBloomFilter::CheckSpecialTransactionMatchesAndUpdate(), CheckSpecialTx(), ContextualCheckTransaction(), IsStandardTx(), ProcessSpecialTx(), ToString(), TxToUniv(), and UndoSpecialTx().
◆ vExtraPayload
const std::vector<uint8_t> CTransaction::vExtraPayload |
Definition at line 220 of file transaction.h.
Referenced by CheckTransaction(), GetTxPayload(), Serialize(), ToString(), and TxToUniv().
◆ vin
const std::vector<CTxIn> CTransaction::vin |
Definition at line 215 of file transaction.h.
Referenced by AcceptToMemoryPoolWorker(), CTxMemPool::addAddressIndex(), CTxMemPool::addSpentIndex(), CWallet::AddToWalletIfInvolvingMe(), CTxMemPool::addUnchecked(), AreInputsStandard(), PeerLogicValidation::BlockConnected(), CDeterministicMNManager::BuildNewListFromBlock(), CalcTxInputsHash(), CTxMemPool::CalculateMemPoolAncestors(), CalculateSequenceLocks(), CTxMemPool::check(), llmq::CInstantSendManager::CheckCanLock(), CheckInputs(), CheckInputsFromMempoolAndCache(), TransactionSignatureChecker::CheckLockTime(), TransactionSignatureChecker::CheckSequence(), CheckSequenceLocks(), CheckTransaction(), Consensus::CheckTxInputs(), CChainState::ConnectBlock(), dashconsensus_verify_script(), CChainState::DisconnectBlock(), entryToJSON(), CWallet::FindNonChangeParentOutput(), getblocktemplate(), llmq::CInstantSendManager::GetConflictingLock(), CWallet::GetDebit(), GetLegacySigOpCount(), GetP2SHSigOpCount(), CCoinsViewCache::GetValueIn(), CTxMemPool::HasNoInputsOf(), CCoinsViewCache::HaveInputs(), CWallet::IsAllFromMe(), IsCoinBase(), CPrivateSend::IsCollateralValid(), IsFinalTx(), IsNull(), CBloomFilter::IsRelevantAndUpdate(), IsStandardTx(), CScriptCheck::operator()(), ProcessMessage(), llmq::CInstantSendManager::ProcessTx(), RecursiveDynamicUsage(), llmq::CInstantSendManager::RemoveConflictedTx(), CTxMemPool::removeConflicts(), CTxMemPool::removeForReorg(), CTxMemPool::removeProTxSpentCollateralConflicts(), Serialize(), SignatureHash(), CWallet::SyncTransaction(), ToString(), llmq::CInstantSendManager::TrySignInstantSendLock(), TxToJSON(), TxToUniv(), and UpdateCoins().
◆ vout
const std::vector<CTxOut> CTransaction::vout |
Definition at line 216 of file transaction.h.
Referenced by AcceptToMemoryPoolWorker(), CTxMemPool::addAddressIndex(), AddCoins(), CWallet::AddToWalletIfInvolvingMe(), CTxMemPool::check(), CheckProRegTx(), CheckTransaction(), CChainState::ConnectBlock(), CChainState::DisconnectBlock(), CWallet::FindNonChangeParentOutput(), CWallet::GetChange(), CWallet::GetCredit(), GetLegacySigOpCount(), GetValueOut(), CPrivateSend::IsCollateralValid(), CWallet::IsMine(), IsNull(), CBloomFilter::IsRelevantAndUpdate(), IsStandardTx(), CMasternodePayments::IsTransactionValid(), CSuperblock::IsValid(), ProcessMessage(), RecursiveDynamicUsage(), CTxMemPool::removeRecursive(), Serialize(), SignatureHash(), SignSignature(), ToString(), TxToJSON(), TxToUniv(), and while().
The documentation for this class was generated from the following files:
- src/primitives/transaction.h
- src/primitives/transaction.cpp