Bitcoin ABC  0.29.2
P2P Digital Currency
Public Types | Public Member Functions | Private Member Functions | 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 <mempool_entry.h>

Collaboration diagram for CTxMemPoolEntry:
[legend]

Public Types

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

Public Member Functions

 CTxMemPoolEntry (const CTransactionRef &_tx, const Amount fee, int64_t time, unsigned int entry_height, int64_t sigchecks, LockPoints lp)
 
 CTxMemPoolEntry (const CTxMemPoolEntry &other)=delete
 
 CTxMemPoolEntry (CTxMemPoolEntry &&other)
 
uint64_t GetEntryId () const
 
void SetEntryId (uint64_t eid)
 This should only be set by addUnchecked() before entry insertion into mempool. More...
 
const CTransactionGetTx () const
 
CTransactionRef GetSharedTx () const
 
Amount GetFee () const
 
size_t GetTxSize () const
 
size_t GetTxVirtualSize () const
 
std::chrono::seconds GetTime () const
 
unsigned int GetHeight () const
 
int64_t GetSigChecks () const
 
Amount GetModifiedFee () const
 
CFeeRate GetModifiedFeeRate () const
 
size_t DynamicMemoryUsage () const
 
const LockPointsGetLockPoints () const
 
void UpdateFeeDelta (Amount newFeeDelta)
 
const ParentsGetMemPoolParentsConst () const
 
const ChildrenGetMemPoolChildrenConst () const
 
ParentsGetMemPoolParents () const
 
ChildrenGetMemPoolChildren () const
 

Private Member Functions

 IMPLEMENT_RCU_REFCOUNT (uint64_t)
 

Private Attributes

uint64_t entryId = 0
 Unique identifier – used for topological sorting. More...
 
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 int64_t sigChecks
 Total sigChecks. 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...
 

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).

Definition at line 65 of file mempool_entry.h.

Member Typedef Documentation

◆ Children

typedef std::set<std::reference_wrapper<const CTxMemPoolEntryRef>, CompareIteratorById> CTxMemPoolEntry::Children

Definition at line 73 of file mempool_entry.h.

◆ Parents

typedef std::set<std::reference_wrapper<const CTxMemPoolEntryRef>, CompareIteratorById> CTxMemPoolEntry::Parents

Definition at line 70 of file mempool_entry.h.

Constructor & Destructor Documentation

◆ CTxMemPoolEntry() [1/3]

CTxMemPoolEntry::CTxMemPoolEntry ( const CTransactionRef _tx,
const Amount  fee,
int64_t  time,
unsigned int  entry_height,
int64_t  sigchecks,
LockPoints  lp 
)
inline

Definition at line 103 of file mempool_entry.h.

◆ CTxMemPoolEntry() [2/3]

CTxMemPoolEntry::CTxMemPoolEntry ( const CTxMemPoolEntry other)
delete

◆ CTxMemPoolEntry() [3/3]

CTxMemPoolEntry::CTxMemPoolEntry ( CTxMemPoolEntry &&  other)
inline

Definition at line 111 of file mempool_entry.h.

Member Function Documentation

◆ DynamicMemoryUsage()

size_t CTxMemPoolEntry::DynamicMemoryUsage ( ) const
inline

Definition at line 142 of file mempool_entry.h.

◆ GetEntryId()

uint64_t CTxMemPoolEntry::GetEntryId ( ) const
inline

Definition at line 121 of file mempool_entry.h.

Here is the caller graph for this function:

◆ GetFee()

Amount CTxMemPoolEntry::GetFee ( ) const
inline

Definition at line 128 of file mempool_entry.h.

◆ GetHeight()

unsigned int CTxMemPoolEntry::GetHeight ( ) const
inline

Definition at line 136 of file mempool_entry.h.

◆ GetLockPoints()

const LockPoints& CTxMemPoolEntry::GetLockPoints ( ) const
inline

Definition at line 143 of file mempool_entry.h.

◆ GetMemPoolChildren()

Children& CTxMemPoolEntry::GetMemPoolChildren ( ) const
inline

Definition at line 151 of file mempool_entry.h.

◆ GetMemPoolChildrenConst()

const Children& CTxMemPoolEntry::GetMemPoolChildrenConst ( ) const
inline

Definition at line 149 of file mempool_entry.h.

◆ GetMemPoolParents()

Parents& CTxMemPoolEntry::GetMemPoolParents ( ) const
inline

Definition at line 150 of file mempool_entry.h.

◆ GetMemPoolParentsConst()

const Parents& CTxMemPoolEntry::GetMemPoolParentsConst ( ) const
inline

Definition at line 148 of file mempool_entry.h.

◆ GetModifiedFee()

Amount CTxMemPoolEntry::GetModifiedFee ( ) const
inline

Definition at line 138 of file mempool_entry.h.

Here is the caller graph for this function:

◆ GetModifiedFeeRate()

CFeeRate CTxMemPoolEntry::GetModifiedFeeRate ( ) const
inline

Definition at line 139 of file mempool_entry.h.

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

◆ GetSharedTx()

CTransactionRef CTxMemPoolEntry::GetSharedTx ( ) const
inline

Definition at line 127 of file mempool_entry.h.

Here is the caller graph for this function:

◆ GetSigChecks()

int64_t CTxMemPoolEntry::GetSigChecks ( ) const
inline

Definition at line 137 of file mempool_entry.h.

◆ GetTime()

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

Definition at line 135 of file mempool_entry.h.

◆ GetTx()

const CTransaction& CTxMemPoolEntry::GetTx ( ) const
inline

Definition at line 126 of file mempool_entry.h.

◆ GetTxSize()

size_t CTxMemPoolEntry::GetTxSize ( ) const
inline

Definition at line 129 of file mempool_entry.h.

◆ GetTxVirtualSize()

size_t CTxMemPoolEntry::GetTxVirtualSize ( ) const
inline

Definition at line 130 of file mempool_entry.h.

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

◆ IMPLEMENT_RCU_REFCOUNT()

CTxMemPoolEntry::IMPLEMENT_RCU_REFCOUNT ( uint64_t  )
private

◆ SetEntryId()

void CTxMemPoolEntry::SetEntryId ( uint64_t  eid)
inline

This should only be set by addUnchecked() before entry insertion into mempool.

Definition at line 124 of file mempool_entry.h.

◆ UpdateFeeDelta()

void CTxMemPoolEntry::UpdateFeeDelta ( Amount  newFeeDelta)
inline

Definition at line 146 of file mempool_entry.h.

Member Data Documentation

◆ entryHeight

const unsigned int CTxMemPoolEntry::entryHeight
private

Chain height when entering the mempool.

Definition at line 91 of file mempool_entry.h.

◆ entryId

uint64_t CTxMemPoolEntry::entryId = 0
private

Unique identifier – used for topological sorting.

Definition at line 77 of file mempool_entry.h.

◆ feeDelta

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

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

Definition at line 96 of file mempool_entry.h.

◆ lockPoints

LockPoints CTxMemPoolEntry::lockPoints
private

Track the height and time at which tx was final.

Definition at line 98 of file mempool_entry.h.

◆ m_children

Children CTxMemPoolEntry::m_children
mutableprivate

Definition at line 81 of file mempool_entry.h.

◆ m_parents

Parents CTxMemPoolEntry::m_parents
mutableprivate

Definition at line 80 of file mempool_entry.h.

◆ nFee

const Amount CTxMemPoolEntry::nFee
private

Cached to avoid expensive parent-transaction lookups.

Definition at line 83 of file mempool_entry.h.

◆ nTime

const int64_t CTxMemPoolEntry::nTime
private

Local time when entering the mempool.

Definition at line 89 of file mempool_entry.h.

◆ nTxSize

const size_t CTxMemPoolEntry::nTxSize
private

... and avoid recomputing tx size

Definition at line 85 of file mempool_entry.h.

◆ nUsageSize

const size_t CTxMemPoolEntry::nUsageSize
private

... and total memory usage

Definition at line 87 of file mempool_entry.h.

◆ sigChecks

const int64_t CTxMemPoolEntry::sigChecks
private

Total sigChecks.

Definition at line 93 of file mempool_entry.h.

◆ tx

const CTransactionRef CTxMemPoolEntry::tx
private

Definition at line 79 of file mempool_entry.h.


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