Bitcoin ABC  0.26.3
P2P Digital Currency
Public Types | Public Member Functions | Public Attributes | Private Attributes | List of all members
CTxMemPoolEntry Class Reference

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>

Collaboration diagram for CTxMemPoolEntry:
[legend]

Public Types

typedef std::reference_wrapper< const CTxMemPoolEntryCTxMemPoolEntryRef
 
typedef std::set< CTxMemPoolEntryRef, CompareIteratorByIdParents
 
typedef std::set< CTxMemPoolEntryRef, CompareIteratorByIdChildren
 

Public Member Functions

 CTxMemPoolEntry (const CTransactionRef &_tx, const Amount fee, int64_t time, unsigned int entry_height, bool spends_coinbase, int64_t sigops_count, LockPoints lp)
 
const CTransactionGetTx () const
 
CTransactionRef GetSharedTx () const
 
const Amount GetFee () const
 
size_t GetTxSize () const
 
size_t GetTxVirtualSize () const
 
std::chrono::seconds GetTime () const
 
unsigned int GetHeight () const
 
int64_t GetSigOpCount () const
 
Amount GetModifiedFee () const
 
size_t DynamicMemoryUsage () const
 
const LockPointsGetLockPoints () const
 
void UpdateDescendantState (int64_t modifySize, Amount modifyFee, int64_t modifyCount, int64_t modifySigOpCount)
 
void UpdateAncestorState (int64_t modifySize, Amount modifyFee, int64_t modifyCount, int64_t modifySigOps)
 
void UpdateFeeDelta (Amount feeDelta)
 
void UpdateLockPoints (const LockPoints &lp)
 
uint64_t GetCountWithDescendants () const
 
uint64_t GetSizeWithDescendants () const
 
uint64_t GetVirtualSizeWithDescendants () const
 
Amount GetModFeesWithDescendants () const
 
int64_t GetSigOpCountWithDescendants () const
 
bool GetSpendsCoinbase () const
 
uint64_t GetCountWithAncestors () const
 
uint64_t GetSizeWithAncestors () const
 
uint64_t GetVirtualSizeWithAncestors () const
 
Amount GetModFeesWithAncestors () const
 
int64_t GetSigOpCountWithAncestors () const
 
const ParentsGetMemPoolParentsConst () const
 
const ChildrenGetMemPoolChildrenConst () const
 
ParentsGetMemPoolParents () const
 
ChildrenGetMemPoolChildren () 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 Amount nFee
 Cached to avoid expensive parent-transaction lookups. More...
 
const size_t nTxSize
 ... and avoid recomputing tx size 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 sigOpCount
 Total sigop plus P2SH sigops count. More...
 
Amount feeDelta {Amount::zero()}
 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...
 
Amount nModFeesWithDescendants
 ... and total fees (all including us) More...
 
int64_t nSigOpCountWithDescendants
 ... and sigop count More...
 
uint64_t nCountWithAncestors {1}
 
uint64_t nSizeWithAncestors
 
Amount nModFeesWithAncestors
 
int64_t 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 88 of file txmempool.h.

Member Typedef Documentation

◆ Children

Definition at line 93 of file txmempool.h.

◆ CTxMemPoolEntryRef

typedef std::reference_wrapper<const CTxMemPoolEntry> CTxMemPoolEntry::CTxMemPoolEntryRef

Definition at line 90 of file txmempool.h.

◆ Parents

Definition at line 92 of file txmempool.h.

Constructor & Destructor Documentation

◆ CTxMemPoolEntry()

CTxMemPoolEntry::CTxMemPoolEntry ( const CTransactionRef _tx,
const Amount  fee,
int64_t  time,
unsigned int  entry_height,
bool  spends_coinbase,
int64_t  sigops_count,
LockPoints  lp 
)

Definition at line 86 of file txmempool.cpp.

Member Function Documentation

◆ DynamicMemoryUsage()

size_t CTxMemPoolEntry::DynamicMemoryUsage ( ) const
inline

Definition at line 157 of file txmempool.h.

◆ GetCountWithAncestors()

uint64_t CTxMemPoolEntry::GetCountWithAncestors ( ) const
inline

Definition at line 182 of file txmempool.h.

◆ GetCountWithDescendants()

uint64_t CTxMemPoolEntry::GetCountWithDescendants ( ) const
inline

Definition at line 172 of file txmempool.h.

◆ GetFee()

const Amount CTxMemPoolEntry::GetFee ( ) const
inline

Definition at line 149 of file txmempool.h.

Here is the caller graph for this function:

◆ GetHeight()

unsigned int CTxMemPoolEntry::GetHeight ( ) const
inline

Definition at line 154 of file txmempool.h.

◆ GetLockPoints()

const LockPoints& CTxMemPoolEntry::GetLockPoints ( ) const
inline

Definition at line 158 of file txmempool.h.

◆ GetMemPoolChildren()

Children& CTxMemPoolEntry::GetMemPoolChildren ( ) const
inline

Definition at line 193 of file txmempool.h.

◆ GetMemPoolChildrenConst()

const Children& CTxMemPoolEntry::GetMemPoolChildrenConst ( ) const
inline

Definition at line 191 of file txmempool.h.

Here is the caller graph for this function:

◆ GetMemPoolParents()

Parents& CTxMemPoolEntry::GetMemPoolParents ( ) const
inline

Definition at line 192 of file txmempool.h.

◆ GetMemPoolParentsConst()

const Parents& CTxMemPoolEntry::GetMemPoolParentsConst ( ) const
inline

Definition at line 190 of file txmempool.h.

◆ GetModFeesWithAncestors()

Amount CTxMemPoolEntry::GetModFeesWithAncestors ( ) const
inline

Definition at line 185 of file txmempool.h.

◆ GetModFeesWithDescendants()

Amount CTxMemPoolEntry::GetModFeesWithDescendants ( ) const
inline

Definition at line 175 of file txmempool.h.

Here is the caller graph for this function:

◆ GetModifiedFee()

Amount CTxMemPoolEntry::GetModifiedFee ( ) const
inline

Definition at line 156 of file txmempool.h.

Here is the caller graph for this function:

◆ GetSharedTx()

CTransactionRef CTxMemPoolEntry::GetSharedTx ( ) const
inline

Definition at line 148 of file txmempool.h.

Here is the caller graph for this function:

◆ GetSigOpCount()

int64_t CTxMemPoolEntry::GetSigOpCount ( ) const
inline

Definition at line 155 of file txmempool.h.

◆ GetSigOpCountWithAncestors()

int64_t CTxMemPoolEntry::GetSigOpCountWithAncestors ( ) const
inline

Definition at line 186 of file txmempool.h.

◆ GetSigOpCountWithDescendants()

int64_t CTxMemPoolEntry::GetSigOpCountWithDescendants ( ) const
inline

Definition at line 176 of file txmempool.h.

◆ GetSizeWithAncestors()

uint64_t CTxMemPoolEntry::GetSizeWithAncestors ( ) const
inline

Definition at line 183 of file txmempool.h.

◆ GetSizeWithDescendants()

uint64_t CTxMemPoolEntry::GetSizeWithDescendants ( ) const
inline

Definition at line 173 of file txmempool.h.

◆ GetSpendsCoinbase()

bool CTxMemPoolEntry::GetSpendsCoinbase ( ) const
inline

Definition at line 180 of file txmempool.h.

◆ GetTime()

std::chrono::seconds CTxMemPoolEntry::GetTime ( ) const
inline

Definition at line 153 of file txmempool.h.

Here is the caller graph for this function:

◆ GetTx()

const CTransaction& CTxMemPoolEntry::GetTx ( ) const
inline

Definition at line 147 of file txmempool.h.

Here is the caller graph for this function:

◆ GetTxSize()

size_t CTxMemPoolEntry::GetTxSize ( ) const
inline

Definition at line 150 of file txmempool.h.

Here is the caller graph for this function:

◆ GetTxVirtualSize()

size_t CTxMemPoolEntry::GetTxVirtualSize ( ) const

Definition at line 98 of file txmempool.cpp.

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

◆ GetVirtualSizeWithAncestors()

uint64_t CTxMemPoolEntry::GetVirtualSizeWithAncestors ( ) const

Definition at line 109 of file txmempool.cpp.

Here is the call graph for this function:

◆ GetVirtualSizeWithDescendants()

uint64_t CTxMemPoolEntry::GetVirtualSizeWithDescendants ( ) const

Definition at line 102 of file txmempool.cpp.

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

◆ UpdateAncestorState()

void CTxMemPoolEntry::UpdateAncestorState ( int64_t  modifySize,
Amount  modifyFee,
int64_t  modifyCount,
int64_t  modifySigOps 
)

Definition at line 506 of file txmempool.cpp.

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

◆ UpdateDescendantState()

void CTxMemPoolEntry::UpdateDescendantState ( int64_t  modifySize,
Amount  modifyFee,
int64_t  modifyCount,
int64_t  modifySigOpCount 
)

Definition at line 493 of file txmempool.cpp.

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

◆ UpdateFeeDelta()

void CTxMemPoolEntry::UpdateFeeDelta ( Amount  feeDelta)

Definition at line 116 of file txmempool.cpp.

Here is the caller graph for this function:

◆ UpdateLockPoints()

void CTxMemPoolEntry::UpdateLockPoints ( const LockPoints lp)

Definition at line 122 of file txmempool.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ entryHeight

const unsigned int CTxMemPoolEntry::entryHeight
private

Chain height when entering the mempool.

Definition at line 108 of file txmempool.h.

◆ feeDelta

Amount CTxMemPoolEntry::feeDelta {Amount::zero()}
private

Used for determining the priority of the transaction for mining in a block.

Definition at line 120 of file txmempool.h.

◆ lockPoints

LockPoints CTxMemPoolEntry::lockPoints
private

Track the height and time at which tx was final.

Definition at line 122 of file txmempool.h.

◆ m_children

Children CTxMemPoolEntry::m_children
mutableprivate

Definition at line 98 of file txmempool.h.

◆ m_epoch_marker

Epoch::Marker CTxMemPoolEntry::m_epoch_marker
mutable

epoch when last touched, useful for graph algorithms

Definition at line 198 of file txmempool.h.

◆ m_parents

Parents CTxMemPoolEntry::m_parents
mutableprivate

Definition at line 97 of file txmempool.h.

◆ nCountWithAncestors

uint64_t CTxMemPoolEntry::nCountWithAncestors {1}
private

Definition at line 137 of file txmempool.h.

◆ nCountWithDescendants

uint64_t CTxMemPoolEntry::nCountWithDescendants {1}
private

number of descendant transactions

Definition at line 128 of file txmempool.h.

◆ nFee

const Amount CTxMemPoolEntry::nFee
private

Cached to avoid expensive parent-transaction lookups.

Definition at line 100 of file txmempool.h.

◆ nModFeesWithAncestors

Amount CTxMemPoolEntry::nModFeesWithAncestors
private

Definition at line 139 of file txmempool.h.

◆ nModFeesWithDescendants

Amount CTxMemPoolEntry::nModFeesWithDescendants
private

... and total fees (all including us)

Definition at line 132 of file txmempool.h.

◆ nSigOpCountWithAncestors

int64_t CTxMemPoolEntry::nSigOpCountWithAncestors
private

Definition at line 140 of file txmempool.h.

◆ nSigOpCountWithDescendants

int64_t CTxMemPoolEntry::nSigOpCountWithDescendants
private

... and sigop count

Definition at line 134 of file txmempool.h.

◆ nSizeWithAncestors

uint64_t CTxMemPoolEntry::nSizeWithAncestors
private

Definition at line 138 of file txmempool.h.

◆ nSizeWithDescendants

uint64_t CTxMemPoolEntry::nSizeWithDescendants
private

... and size

Definition at line 130 of file txmempool.h.

◆ nTime

const int64_t CTxMemPoolEntry::nTime
private

Local time when entering the mempool.

Definition at line 106 of file txmempool.h.

◆ nTxSize

const size_t CTxMemPoolEntry::nTxSize
private

... and avoid recomputing tx size

Definition at line 102 of file txmempool.h.

◆ nUsageSize

const size_t CTxMemPoolEntry::nUsageSize
private

... and total memory usage

Definition at line 104 of file txmempool.h.

◆ sigOpCount

const int64_t CTxMemPoolEntry::sigOpCount
private

Total sigop plus P2SH sigops count.

After the sigchecks activation we repurpose the 'sigops' tracking in mempool/mining to actually track sigchecks instead. (Proper SigOps will not need to be counted any more since it's getting deactivated.)

Definition at line 117 of file txmempool.h.

◆ spendsCoinbase

const bool CTxMemPoolEntry::spendsCoinbase
private

keep track of transactions that spend a coinbase

Definition at line 110 of file txmempool.h.

◆ tx

const CTransactionRef CTxMemPoolEntry::tx
private

Definition at line 96 of file txmempool.h.

◆ vTxHashesIdx

size_t CTxMemPoolEntry::vTxHashesIdx
mutable

Index in mempool's vTxHashes.

Definition at line 196 of file txmempool.h.


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