![]() |
Bitcoin Core
23.99.0
P2P Digital Currency
|
#include <txmempool.h>
Public Types | |
typedef std::reference_wrapper< const CTxMemPoolEntry > | CTxMemPoolEntryRef |
typedef std::set< CTxMemPoolEntryRef, CompareIteratorByHash > | Parents |
typedef std::set< CTxMemPoolEntryRef, CompareIteratorByHash > | Children |
Public Member Functions | |
CTxMemPoolEntry (const CTransactionRef &tx, CAmount fee, int64_t time, unsigned int entry_height, bool spends_coinbase, int64_t sigops_cost, LockPoints lp) | |
const CTransaction & | GetTx () const |
CTransactionRef | GetSharedTx () const |
const CAmount & | GetFee () const |
size_t | GetTxSize () const |
size_t | GetTxWeight () const |
std::chrono::seconds | GetTime () const |
unsigned int | GetHeight () const |
int64_t | GetSigOpCost () const |
CAmount | 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 | UpdateModifiedFee (CAmount fee_diff) |
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 |
int64_t | GetSigOpCostWithAncestors () const |
const Parents & | GetMemPoolParentsConst () const |
const Children & | GetMemPoolChildrenConst () const |
Parents & | GetMemPoolParents () const |
Children & | GetMemPoolChildren () const |
Public Attributes | |
size_t | vTxHashesIdx |
Index in mempool's vTxHashes. More... | |
Epoch::Marker | m_epoch_marker |
epoch when last touched, useful for graph algorithms More... | |
Private Attributes | |
const CTransactionRef | tx |
Parents | m_parents |
Children | m_children |
const CAmount | nFee |
Cached to avoid expensive parent-transaction lookups. More... | |
const size_t | nTxWeight |
... and avoid recomputing tx weight (also used for GetTxSize()) More... | |
const size_t | nUsageSize |
... and total memory usage More... | |
const int64_t | nTime |
Local time when entering the mempool. More... | |
const unsigned int | entryHeight |
Chain height when entering the mempool. More... | |
const bool | spendsCoinbase |
keep track of transactions that spend a coinbase More... | |
const int64_t | sigOpCost |
Total sigop cost. More... | |
CAmount | m_modified_fee |
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 {1} |
number of descendant transactions More... | |
uint64_t | nSizeWithDescendants |
... and size More... | |
CAmount | nModFeesWithDescendants |
... and total fees (all including us) More... | |
uint64_t | nCountWithAncestors {1} |
uint64_t | nSizeWithAncestors |
CAmount | nModFeesWithAncestors |
int64_t | nSigOpCostWithAncestors |
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 88 of file txmempool.h.
typedef std::set<CTxMemPoolEntryRef, CompareIteratorByHash> CTxMemPoolEntry::Children |
Definition at line 94 of file txmempool.h.
typedef std::reference_wrapper<const CTxMemPoolEntry> CTxMemPoolEntry::CTxMemPoolEntryRef |
Definition at line 91 of file txmempool.h.
typedef std::set<CTxMemPoolEntryRef, CompareIteratorByHash> CTxMemPoolEntry::Parents |
Definition at line 93 of file txmempool.h.
CTxMemPoolEntry::CTxMemPoolEntry | ( | const CTransactionRef & | tx, |
CAmount | fee, | ||
int64_t | time, | ||
unsigned int | entry_height, | ||
bool | spends_coinbase, | ||
int64_t | sigops_cost, | ||
LockPoints | lp | ||
) |
Definition at line 76 of file txmempool.cpp.
|
inline |
Definition at line 138 of file txmempool.h.
|
inline |
Definition at line 156 of file txmempool.h.
|
inline |
Definition at line 150 of file txmempool.h.
|
inline |
|
inline |
|
inline |
Definition at line 139 of file txmempool.h.
|
inline |
Definition at line 164 of file txmempool.h.
|
inline |
|
inline |
Definition at line 163 of file txmempool.h.
|
inline |
Definition at line 161 of file txmempool.h.
|
inline |
Definition at line 158 of file txmempool.h.
|
inline |
|
inline |
|
inline |
Definition at line 130 of file txmempool.h.
|
inline |
Definition at line 136 of file txmempool.h.
|
inline |
Definition at line 159 of file txmempool.h.
|
inline |
Definition at line 157 of file txmempool.h.
|
inline |
|
inline |
Definition at line 154 of file txmempool.h.
|
inline |
|
inline |
size_t CTxMemPoolEntry::GetTxSize | ( | ) | const |
Definition at line 107 of file txmempool.cpp.
|
inline |
Definition at line 133 of file txmempool.h.
void CTxMemPoolEntry::UpdateAncestorState | ( | int64_t | modifySize, |
CAmount | modifyFee, | ||
int64_t | modifyCount, | ||
int64_t | modifySigOps | ||
) |
Definition at line 445 of file txmempool.cpp.
void CTxMemPoolEntry::UpdateDescendantState | ( | int64_t | modifySize, |
CAmount | modifyFee, | ||
int64_t | modifyCount | ||
) |
Definition at line 436 of file txmempool.cpp.
void CTxMemPoolEntry::UpdateLockPoints | ( | const LockPoints & | lp | ) |
void CTxMemPoolEntry::UpdateModifiedFee | ( | CAmount | fee_diff | ) |
Definition at line 95 of file txmempool.cpp.
|
private |
Chain height when entering the mempool.
Definition at line 104 of file txmempool.h.
|
private |
Track the height and time at which tx was final.
Definition at line 108 of file txmempool.h.
|
mutableprivate |
Definition at line 99 of file txmempool.h.
|
mutable |
epoch when last touched, useful for graph algorithms
Definition at line 167 of file txmempool.h.
|
private |
Used for determining the priority of the transaction for mining in a block.
Definition at line 107 of file txmempool.h.
|
mutableprivate |
Definition at line 98 of file txmempool.h.
|
private |
Definition at line 118 of file txmempool.h.
|
private |
number of descendant transactions
Definition at line 113 of file txmempool.h.
|
private |
Cached to avoid expensive parent-transaction lookups.
Definition at line 100 of file txmempool.h.
|
private |
Definition at line 120 of file txmempool.h.
|
private |
... and total fees (all including us)
Definition at line 115 of file txmempool.h.
|
private |
Definition at line 121 of file txmempool.h.
|
private |
Definition at line 119 of file txmempool.h.
|
private |
... and size
Definition at line 114 of file txmempool.h.
|
private |
Local time when entering the mempool.
Definition at line 103 of file txmempool.h.
|
private |
... and avoid recomputing tx weight (also used for GetTxSize())
Definition at line 101 of file txmempool.h.
|
private |
... and total memory usage
Definition at line 102 of file txmempool.h.
|
private |
Total sigop cost.
Definition at line 106 of file txmempool.h.
|
private |
keep track of transactions that spend a coinbase
Definition at line 105 of file txmempool.h.
|
private |
Definition at line 97 of file txmempool.h.
|
mutable |
Index in mempool's vTxHashes.
Definition at line 166 of file txmempool.h.