Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
CTxMemPoolEntry stores data about the corresponding transaction, as well as data about all in-mempool transactions that depend on the transaction ("descendant" transactions). More...
#include <txmempool.h>
Public Member Functions | |
CTxMemPoolEntry (const CTransactionRef &_tx, const CAmount &_nFee, int64_t _nTime, unsigned int _entryHeight, bool spendsCoinbase, unsigned int nSigOps, LockPoints lp) | |
const CTransaction & | GetTx () const |
CTransactionRef | GetSharedTx () const |
const CAmount & | GetFee () const |
size_t | GetTxSize () const |
int64_t | GetTime () const |
unsigned int | GetHeight () const |
unsigned int | GetSigOpCount () const |
int64_t | GetModifiedFee () const |
size_t | DynamicMemoryUsage () const |
const LockPoints & | GetLockPoints () const |
void | UpdateDescendantState (int64_t modifySize, CAmount modifyFee, int64_t modifyCount) |
void | UpdateAncestorState (int64_t modifySize, CAmount modifyFee, int64_t modifyCount, int64_t modifySigOps) |
void | UpdateFeeDelta (int64_t feeDelta) |
void | UpdateLockPoints (const LockPoints &lp) |
uint64_t | GetCountWithDescendants () const |
uint64_t | GetSizeWithDescendants () const |
CAmount | GetModFeesWithDescendants () const |
bool | GetSpendsCoinbase () const |
uint64_t | GetCountWithAncestors () const |
uint64_t | GetSizeWithAncestors () const |
CAmount | GetModFeesWithAncestors () const |
unsigned int | GetSigOpCountWithAncestors () const |
Public Attributes | |
size_t | vTxHashesIdx |
Index in mempool's vTxHashes. More... | |
uint256 | validForProTxKey |
bool | isKeyChangeProTx {false} |
Private Attributes | |
CTransactionRef | tx |
CAmount | nFee |
Cached to avoid expensive parent-transaction lookups. More... | |
size_t | nTxSize |
... and avoid recomputing tx size More... | |
size_t | nUsageSize |
... and total memory usage More... | |
int64_t | nTime |
Local time when entering the mempool. More... | |
unsigned int | entryHeight |
Chain height when entering the mempool. More... | |
bool | spendsCoinbase |
keep track of transactions that spend a coinbase More... | |
unsigned int | sigOpCount |
Legacy sig ops plus P2SH sig op count. More... | |
int64_t | feeDelta |
Used for determining the priority of the transaction for mining in a block. More... | |
LockPoints | lockPoints |
Track the height and time at which tx was final. More... | |
uint64_t | nCountWithDescendants |
number of descendant transactions More... | |
uint64_t | nSizeWithDescendants |
... and size More... | |
CAmount | nModFeesWithDescendants |
... and total fees (all including us) More... | |
uint64_t | nCountWithAncestors |
uint64_t | nSizeWithAncestors |
CAmount | nModFeesWithAncestors |
unsigned int | nSigOpCountWithAncestors |
Detailed Description
CTxMemPoolEntry stores data about the corresponding transaction, as well as data about all in-mempool transactions that depend on the transaction ("descendant" transactions).
When a new entry is added to the mempool, we update the descendant state (nCountWithDescendants, nSizeWithDescendants, and nModFeesWithDescendants) for all ancestors of the newly added transaction.
Definition at line 69 of file txmempool.h.
Constructor & Destructor Documentation
◆ CTxMemPoolEntry()
CTxMemPoolEntry::CTxMemPoolEntry | ( | const CTransactionRef & | _tx, |
const CAmount & | _nFee, | ||
int64_t | _nTime, | ||
unsigned int | _entryHeight, | ||
bool | spendsCoinbase, | ||
unsigned int | nSigOps, | ||
LockPoints | lp | ||
) |
Definition at line 28 of file txmempool.cpp.
References feeDelta, GetSerializeSize(), nCountWithAncestors, nCountWithDescendants, nFee, nModFeesWithAncestors, nModFeesWithDescendants, nSigOpCountWithAncestors, nSizeWithAncestors, nSizeWithDescendants, nTxSize, nUsageSize, PROTOCOL_VERSION, RecursiveDynamicUsage(), SER_NETWORK, sigOpCount, and tx.
Member Function Documentation
◆ DynamicMemoryUsage()
|
inline |
Definition at line 110 of file txmempool.h.
References nUsageSize.
Referenced by CTxMemPool::addUnchecked().
◆ GetCountWithAncestors()
|
inline |
Definition at line 129 of file txmempool.h.
References nCountWithAncestors.
Referenced by entryToJSON().
◆ GetCountWithDescendants()
|
inline |
Definition at line 123 of file txmempool.h.
References nCountWithDescendants.
Referenced by entryToJSON().
◆ GetFee()
|
inline |
Definition at line 104 of file txmempool.h.
References nFee.
Referenced by entryToJSON(), CBlockPolicyEstimator::processBlockTx(), and CBlockPolicyEstimator::processTransaction().
◆ GetHeight()
|
inline |
Definition at line 107 of file txmempool.h.
References entryHeight.
Referenced by entryToJSON(), CBlockPolicyEstimator::processBlockTx(), and CBlockPolicyEstimator::processTransaction().
◆ GetLockPoints()
|
inline |
Definition at line 111 of file txmempool.h.
References lockPoints.
◆ GetModFeesWithAncestors()
|
inline |
Definition at line 131 of file txmempool.h.
References nModFeesWithAncestors.
Referenced by entryToJSON().
◆ GetModFeesWithDescendants()
|
inline |
Definition at line 125 of file txmempool.h.
References nModFeesWithDescendants.
Referenced by entryToJSON(), and CompareTxMemPoolEntryByDescendantScore::GetModFeeAndSize().
◆ GetModifiedFee()
|
inline |
Definition at line 109 of file txmempool.h.
References feeDelta, and nFee.
Referenced by entryToJSON(), CompareTxMemPoolEntryByDescendantScore::GetModFeeAndSize(), and CompareTxMemPoolEntryByScore::operator()().
◆ GetSharedTx()
|
inline |
Definition at line 103 of file txmempool.h.
References tx.
Referenced by CTxMemPool::addUnchecked().
◆ GetSigOpCount()
|
inline |
Definition at line 108 of file txmempool.h.
References sigOpCount.
◆ GetSigOpCountWithAncestors()
|
inline |
Definition at line 132 of file txmempool.h.
References nSigOpCountWithAncestors.
◆ GetSizeWithAncestors()
|
inline |
Definition at line 130 of file txmempool.h.
References nSizeWithAncestors.
Referenced by entryToJSON().
◆ GetSizeWithDescendants()
|
inline |
Definition at line 124 of file txmempool.h.
References nSizeWithDescendants.
Referenced by entryToJSON(), and CompareTxMemPoolEntryByDescendantScore::GetModFeeAndSize().
◆ GetSpendsCoinbase()
|
inline |
Definition at line 127 of file txmempool.h.
References spendsCoinbase.
◆ GetTime()
|
inline |
Definition at line 106 of file txmempool.h.
References nTime.
Referenced by CTxMemPool::addAddressIndex(), entryToJSON(), CompareTxMemPoolEntryByDescendantScore::operator()(), and CompareTxMemPoolEntryByEntryTime::operator()().
◆ GetTx()
|
inline |
Definition at line 102 of file txmempool.h.
References tx.
Referenced by CTxMemPool::addAddressIndex(), CTxMemPool::addSpentIndex(), CTxMemPool::CalculateMemPoolAncestors(), CTxMemPool::check(), entryToJSON(), getmempoolancestors(), getmempooldescendants(), mempoolToJSON(), mempoolentry_txid::operator()(), CompareTxMemPoolEntryByScore::operator()(), CBlockPolicyEstimator::processBlockTx(), and CBlockPolicyEstimator::processTransaction().
◆ GetTxSize()
|
inline |
Definition at line 105 of file txmempool.h.
References nTxSize.
Referenced by AcceptToMemoryPoolWorker(), CTxMemPool::addUnchecked(), CTxMemPool::CalculateMemPoolAncestors(), entryToJSON(), CompareTxMemPoolEntryByDescendantScore::GetModFeeAndSize(), CompareTxMemPoolEntryByScore::operator()(), CBlockPolicyEstimator::processBlockTx(), and CBlockPolicyEstimator::processTransaction().
◆ UpdateAncestorState()
void CTxMemPoolEntry::UpdateAncestorState | ( | int64_t | modifySize, |
CAmount | modifyFee, | ||
int64_t | modifyCount, | ||
int64_t | modifySigOps | ||
) |
Definition at line 322 of file txmempool.cpp.
References nCountWithAncestors, nModFeesWithAncestors, nSigOpCountWithAncestors, and nSizeWithAncestors.
Referenced by update_ancestor_state::operator()().
◆ UpdateDescendantState()
void CTxMemPoolEntry::UpdateDescendantState | ( | int64_t | modifySize, |
CAmount | modifyFee, | ||
int64_t | modifyCount | ||
) |
Definition at line 313 of file txmempool.cpp.
References nCountWithDescendants, nModFeesWithDescendants, and nSizeWithDescendants.
Referenced by update_descendant_state::operator()().
◆ UpdateFeeDelta()
void CTxMemPoolEntry::UpdateFeeDelta | ( | int64_t | feeDelta | ) |
Definition at line 49 of file txmempool.cpp.
References feeDelta, nModFeesWithAncestors, and nModFeesWithDescendants.
Referenced by update_fee_delta::operator()().
◆ UpdateLockPoints()
void CTxMemPoolEntry::UpdateLockPoints | ( | const LockPoints & | lp | ) |
Definition at line 56 of file txmempool.cpp.
References lockPoints.
Referenced by update_lock_points::operator()().
Member Data Documentation
◆ entryHeight
|
private |
Chain height when entering the mempool.
Definition at line 77 of file txmempool.h.
Referenced by GetHeight().
◆ feeDelta
|
private |
Used for determining the priority of the transaction for mining in a block.
Definition at line 80 of file txmempool.h.
Referenced by CTxMemPoolEntry(), GetModifiedFee(), and UpdateFeeDelta().
◆ isKeyChangeProTx
|
mutable |
Definition at line 138 of file txmempool.h.
◆ lockPoints
|
private |
Track the height and time at which tx was final.
Definition at line 81 of file txmempool.h.
Referenced by GetLockPoints(), and UpdateLockPoints().
◆ nCountWithAncestors
|
private |
Definition at line 91 of file txmempool.h.
Referenced by CTxMemPoolEntry(), GetCountWithAncestors(), and UpdateAncestorState().
◆ nCountWithDescendants
|
private |
number of descendant transactions
Definition at line 86 of file txmempool.h.
Referenced by CTxMemPoolEntry(), GetCountWithDescendants(), and UpdateDescendantState().
◆ nFee
|
private |
Cached to avoid expensive parent-transaction lookups.
Definition at line 73 of file txmempool.h.
Referenced by CTxMemPoolEntry(), GetFee(), and GetModifiedFee().
◆ nModFeesWithAncestors
|
private |
Definition at line 93 of file txmempool.h.
Referenced by CTxMemPoolEntry(), GetModFeesWithAncestors(), UpdateAncestorState(), and UpdateFeeDelta().
◆ nModFeesWithDescendants
|
private |
... and total fees (all including us)
Definition at line 88 of file txmempool.h.
Referenced by CTxMemPoolEntry(), GetModFeesWithDescendants(), UpdateDescendantState(), and UpdateFeeDelta().
◆ nSigOpCountWithAncestors
|
private |
Definition at line 94 of file txmempool.h.
Referenced by CTxMemPoolEntry(), GetSigOpCountWithAncestors(), and UpdateAncestorState().
◆ nSizeWithAncestors
|
private |
Definition at line 92 of file txmempool.h.
Referenced by CTxMemPoolEntry(), GetSizeWithAncestors(), and UpdateAncestorState().
◆ nSizeWithDescendants
|
private |
... and size
Definition at line 87 of file txmempool.h.
Referenced by CTxMemPoolEntry(), GetSizeWithDescendants(), and UpdateDescendantState().
◆ nTime
|
private |
Local time when entering the mempool.
Definition at line 76 of file txmempool.h.
Referenced by GetTime().
◆ nTxSize
|
private |
... and avoid recomputing tx size
Definition at line 74 of file txmempool.h.
Referenced by CTxMemPoolEntry(), and GetTxSize().
◆ nUsageSize
|
private |
... and total memory usage
Definition at line 75 of file txmempool.h.
Referenced by CTxMemPoolEntry(), and DynamicMemoryUsage().
◆ sigOpCount
|
private |
Legacy sig ops plus P2SH sig op count.
Definition at line 79 of file txmempool.h.
Referenced by CTxMemPoolEntry(), and GetSigOpCount().
◆ spendsCoinbase
|
private |
keep track of transactions that spend a coinbase
Definition at line 78 of file txmempool.h.
Referenced by GetSpendsCoinbase().
◆ tx
|
private |
Definition at line 72 of file txmempool.h.
Referenced by CTxMemPoolEntry(), GetSharedTx(), and GetTx().
◆ validForProTxKey
|
mutable |
Definition at line 137 of file txmempool.h.
◆ vTxHashesIdx
|
mutable |
Index in mempool's vTxHashes.
Definition at line 134 of file txmempool.h.
The documentation for this class was generated from the following files:
- src/txmempool.h
- src/txmempool.cpp