Bitcoin ABC  0.26.3
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 <txmempool.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, bool spends_coinbase, 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 feeDelta)
 
void UpdateLockPoints (const LockPoints &lp)
 
bool GetSpendsCoinbase () const
 
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 bool spendsCoinbase
 keep track of transactions that spend a coinbase 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 103 of file txmempool.h.

Member Typedef Documentation

◆ Children

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

Definition at line 111 of file txmempool.h.

◆ Parents

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

Definition at line 108 of file txmempool.h.

Constructor & Destructor Documentation

◆ CTxMemPoolEntry() [1/3]

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

Definition at line 52 of file txmempool.cpp.

◆ CTxMemPoolEntry() [2/3]

CTxMemPoolEntry::CTxMemPoolEntry ( const CTxMemPoolEntry other)
delete

◆ CTxMemPoolEntry() [3/3]

CTxMemPoolEntry::CTxMemPoolEntry ( CTxMemPoolEntry &&  other)
inline

Definition at line 148 of file txmempool.h.

Member Function Documentation

◆ DynamicMemoryUsage()

size_t CTxMemPoolEntry::DynamicMemoryUsage ( ) const
inline

Definition at line 176 of file txmempool.h.

◆ GetEntryId()

uint64_t CTxMemPoolEntry::GetEntryId ( ) const
inline

Definition at line 158 of file txmempool.h.

Here is the caller graph for this function:

◆ GetFee()

Amount CTxMemPoolEntry::GetFee ( ) const
inline

Definition at line 165 of file txmempool.h.

◆ GetHeight()

unsigned int CTxMemPoolEntry::GetHeight ( ) const
inline

Definition at line 170 of file txmempool.h.

◆ GetLockPoints()

const LockPoints& CTxMemPoolEntry::GetLockPoints ( ) const
inline

Definition at line 177 of file txmempool.h.

◆ GetMemPoolChildren()

Children& CTxMemPoolEntry::GetMemPoolChildren ( ) const
inline

Definition at line 189 of file txmempool.h.

◆ GetMemPoolChildrenConst()

const Children& CTxMemPoolEntry::GetMemPoolChildrenConst ( ) const
inline

Definition at line 187 of file txmempool.h.

◆ GetMemPoolParents()

Parents& CTxMemPoolEntry::GetMemPoolParents ( ) const
inline

Definition at line 188 of file txmempool.h.

◆ GetMemPoolParentsConst()

const Parents& CTxMemPoolEntry::GetMemPoolParentsConst ( ) const
inline

Definition at line 186 of file txmempool.h.

◆ GetModifiedFee()

Amount CTxMemPoolEntry::GetModifiedFee ( ) const
inline

Definition at line 172 of file txmempool.h.

Here is the caller graph for this function:

◆ GetModifiedFeeRate()

CFeeRate CTxMemPoolEntry::GetModifiedFeeRate ( ) const
inline

Definition at line 173 of file txmempool.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 164 of file txmempool.h.

Here is the caller graph for this function:

◆ GetSigChecks()

int64_t CTxMemPoolEntry::GetSigChecks ( ) const
inline

Definition at line 171 of file txmempool.h.

◆ GetSpendsCoinbase()

bool CTxMemPoolEntry::GetSpendsCoinbase ( ) const
inline

Definition at line 184 of file txmempool.h.

◆ GetTime()

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

Definition at line 169 of file txmempool.h.

◆ GetTx()

const CTransaction& CTxMemPoolEntry::GetTx ( ) const
inline

Definition at line 163 of file txmempool.h.

◆ GetTxSize()

size_t CTxMemPoolEntry::GetTxSize ( ) const
inline

Definition at line 166 of file txmempool.h.

◆ GetTxVirtualSize()

size_t CTxMemPoolEntry::GetTxVirtualSize ( ) const

Definition at line 61 of file txmempool.cpp.

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 161 of file txmempool.h.

◆ UpdateFeeDelta()

void CTxMemPoolEntry::UpdateFeeDelta ( Amount  feeDelta)

Definition at line 65 of file txmempool.cpp.

◆ UpdateLockPoints()

void CTxMemPoolEntry::UpdateLockPoints ( const LockPoints lp)

Definition at line 69 of file txmempool.cpp.

Member Data Documentation

◆ entryHeight

const unsigned int CTxMemPoolEntry::entryHeight
private

Chain height when entering the mempool.

Definition at line 129 of file txmempool.h.

◆ entryId

uint64_t CTxMemPoolEntry::entryId = 0
private

Unique identifier – used for topological sorting.

Definition at line 115 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 136 of file txmempool.h.

◆ lockPoints

LockPoints CTxMemPoolEntry::lockPoints
private

Track the height and time at which tx was final.

Definition at line 138 of file txmempool.h.

◆ m_children

Children CTxMemPoolEntry::m_children
mutableprivate

Definition at line 119 of file txmempool.h.

◆ m_parents

Parents CTxMemPoolEntry::m_parents
mutableprivate

Definition at line 118 of file txmempool.h.

◆ nFee

const Amount CTxMemPoolEntry::nFee
private

Cached to avoid expensive parent-transaction lookups.

Definition at line 121 of file txmempool.h.

◆ nTime

const int64_t CTxMemPoolEntry::nTime
private

Local time when entering the mempool.

Definition at line 127 of file txmempool.h.

◆ nTxSize

const size_t CTxMemPoolEntry::nTxSize
private

... and avoid recomputing tx size

Definition at line 123 of file txmempool.h.

◆ nUsageSize

const size_t CTxMemPoolEntry::nUsageSize
private

... and total memory usage

Definition at line 125 of file txmempool.h.

◆ sigChecks

const int64_t CTxMemPoolEntry::sigChecks
private

Total sigChecks.

Definition at line 133 of file txmempool.h.

◆ spendsCoinbase

const bool CTxMemPoolEntry::spendsCoinbase
private

keep track of transactions that spend a coinbase

Definition at line 131 of file txmempool.h.

◆ tx

const CTransactionRef CTxMemPoolEntry::tx
private

Definition at line 117 of file txmempool.h.


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