Bitcoin Core 30.99.0
P2P Digital Currency
Public Types | Public Member Functions | Public Attributes | 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>

Inheritance diagram for CTxMemPoolEntry:
[legend]
Collaboration diagram for CTxMemPoolEntry:
[legend]

Public Types

typedef std::reference_wrapper< const CTxMemPoolEntryCTxMemPoolEntryRef
 

Public Member Functions

virtual ~CTxMemPoolEntry ()=default
 
 CTxMemPoolEntry (TxGraph::Ref &&ref, const CTransactionRef &tx, CAmount fee, int64_t time, unsigned int entry_height, uint64_t entry_sequence, bool spends_coinbase, int64_t sigops_cost, LockPoints lp)
 
CTxMemPoolEntryoperator= (const CTxMemPoolEntry &)=delete
 
 CTxMemPoolEntry (CTxMemPoolEntry &&)=default
 
CTxMemPoolEntryoperator= (CTxMemPoolEntry &&)=delete
 
const CTransactionGetTx () const
 
CTransactionRef GetSharedTx () const
 
const CAmountGetFee () const
 
int32_t GetTxSize () const
 
int32_t GetAdjustedWeight () const
 
int32_t GetTxWeight () const
 
std::chrono::seconds GetTime () const
 
unsigned int GetHeight () const
 
uint64_t GetSequence () const
 
int64_t GetSigOpCost () const
 
CAmount GetModifiedFee () const
 
size_t DynamicMemoryUsage () const
 
const LockPointsGetLockPoints () const
 
void UpdateModifiedFee (CAmount fee_diff)
 
void UpdateLockPoints (const LockPoints &lp) const
 
bool GetSpendsCoinbase () const
 
- Public Member Functions inherited from TxGraph::Ref
 Ref () noexcept=default
 Construct an empty Ref. More...
 
virtual ~Ref ()
 Destroy this Ref. More...
 
Refoperator= (Ref &&other) noexcept=delete
 
 Ref (Ref &&other) noexcept
 
Refoperator= (const Ref &)=delete
 
 Ref (const Ref &)=delete
 

Public Attributes

size_t idx_randomized
 Index in mempool's txns_randomized. More...
 
Epoch::Marker m_epoch_marker
 epoch when last touched, useful for graph algorithms More...
 

Private Member Functions

 CTxMemPoolEntry (const CTxMemPoolEntry &)=delete
 

Private Attributes

const CTransactionRef tx
 
const CAmount nFee
 Cached to avoid expensive parent-transaction lookups. More...
 
const int32_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 uint64_t entry_sequence
 Sequence number used to determine whether this transaction is too recent for relay. 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...
 

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 (m_count_with_descendants, nSizeWithDescendants, and nModFeesWithDescendants) for all ancestors of the newly added transaction.

Definition at line 66 of file mempool_entry.h.

Member Typedef Documentation

◆ CTxMemPoolEntryRef

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

Definition at line 69 of file mempool_entry.h.

Constructor & Destructor Documentation

◆ CTxMemPoolEntry() [1/3]

CTxMemPoolEntry::CTxMemPoolEntry ( const CTxMemPoolEntry )
privatedelete

◆ ~CTxMemPoolEntry()

virtual CTxMemPoolEntry::~CTxMemPoolEntry ( )
virtualdefault

◆ CTxMemPoolEntry() [2/3]

CTxMemPoolEntry::CTxMemPoolEntry ( TxGraph::Ref &&  ref,
const CTransactionRef tx,
CAmount  fee,
int64_t  time,
unsigned int  entry_height,
uint64_t  entry_sequence,
bool  spends_coinbase,
int64_t  sigops_cost,
LockPoints  lp 
)
inline

Definition at line 88 of file mempool_entry.h.

◆ CTxMemPoolEntry() [3/3]

CTxMemPoolEntry::CTxMemPoolEntry ( CTxMemPoolEntry &&  )
default

Member Function Documentation

◆ DynamicMemoryUsage()

size_t CTxMemPoolEntry::DynamicMemoryUsage ( ) const
inline

Definition at line 123 of file mempool_entry.h.

Here is the caller graph for this function:

◆ GetAdjustedWeight()

int32_t CTxMemPoolEntry::GetAdjustedWeight ( ) const
inline

Definition at line 116 of file mempool_entry.h.

Here is the call graph for this function:

◆ GetFee()

const CAmount & CTxMemPoolEntry::GetFee ( ) const
inline

Definition at line 111 of file mempool_entry.h.

Here is the caller graph for this function:

◆ GetHeight()

unsigned int CTxMemPoolEntry::GetHeight ( ) const
inline

Definition at line 119 of file mempool_entry.h.

Here is the caller graph for this function:

◆ GetLockPoints()

const LockPoints & CTxMemPoolEntry::GetLockPoints ( ) const
inline

Definition at line 124 of file mempool_entry.h.

Here is the caller graph for this function:

◆ GetModifiedFee()

CAmount CTxMemPoolEntry::GetModifiedFee ( ) const
inline

Definition at line 122 of file mempool_entry.h.

Here is the caller graph for this function:

◆ GetSequence()

uint64_t CTxMemPoolEntry::GetSequence ( ) const
inline

Definition at line 120 of file mempool_entry.h.

Here is the caller graph for this function:

◆ GetSharedTx()

CTransactionRef CTxMemPoolEntry::GetSharedTx ( ) const
inline

Definition at line 110 of file mempool_entry.h.

Here is the caller graph for this function:

◆ GetSigOpCost()

int64_t CTxMemPoolEntry::GetSigOpCost ( ) const
inline

Definition at line 121 of file mempool_entry.h.

Here is the caller graph for this function:

◆ GetSpendsCoinbase()

bool CTxMemPoolEntry::GetSpendsCoinbase ( ) const
inline

Definition at line 138 of file mempool_entry.h.

Here is the caller graph for this function:

◆ GetTime()

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

Definition at line 118 of file mempool_entry.h.

Here is the caller graph for this function:

◆ GetTx()

const CTransaction & CTxMemPoolEntry::GetTx ( ) const
inline

Definition at line 109 of file mempool_entry.h.

Here is the caller graph for this function:

◆ GetTxSize()

int32_t CTxMemPoolEntry::GetTxSize ( ) const
inline

Definition at line 112 of file mempool_entry.h.

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

◆ GetTxWeight()

int32_t CTxMemPoolEntry::GetTxWeight ( ) const
inline

Definition at line 117 of file mempool_entry.h.

Here is the caller graph for this function:

◆ operator=() [1/2]

CTxMemPoolEntry & CTxMemPoolEntry::operator= ( const CTxMemPoolEntry )
delete

◆ operator=() [2/2]

CTxMemPoolEntry & CTxMemPoolEntry::operator= ( CTxMemPoolEntry &&  )
delete

◆ UpdateLockPoints()

void CTxMemPoolEntry::UpdateLockPoints ( const LockPoints lp) const
inline

Definition at line 133 of file mempool_entry.h.

◆ UpdateModifiedFee()

void CTxMemPoolEntry::UpdateModifiedFee ( CAmount  fee_diff)
inline

Definition at line 127 of file mempool_entry.h.

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

Member Data Documentation

◆ entry_sequence

const uint64_t CTxMemPoolEntry::entry_sequence
private

Sequence number used to determine whether this transaction is too recent for relay.

Definition at line 79 of file mempool_entry.h.

◆ entryHeight

const unsigned int CTxMemPoolEntry::entryHeight
private

Chain height when entering the mempool.

Definition at line 80 of file mempool_entry.h.

◆ idx_randomized

size_t CTxMemPoolEntry::idx_randomized
mutable

Index in mempool's txns_randomized.

Definition at line 140 of file mempool_entry.h.

◆ lockPoints

LockPoints CTxMemPoolEntry::lockPoints
mutableprivate

Track the height and time at which tx was final.

Definition at line 84 of file mempool_entry.h.

◆ m_epoch_marker

Epoch::Marker CTxMemPoolEntry::m_epoch_marker
mutable

epoch when last touched, useful for graph algorithms

Definition at line 141 of file mempool_entry.h.

◆ m_modified_fee

CAmount CTxMemPoolEntry::m_modified_fee
private

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

Definition at line 83 of file mempool_entry.h.

◆ nFee

const CAmount CTxMemPoolEntry::nFee
private

Cached to avoid expensive parent-transaction lookups.

Definition at line 75 of file mempool_entry.h.

◆ nTime

const int64_t CTxMemPoolEntry::nTime
private

Local time when entering the mempool.

Definition at line 78 of file mempool_entry.h.

◆ nTxWeight

const int32_t CTxMemPoolEntry::nTxWeight
private

... and avoid recomputing tx weight (also used for GetTxSize())

Definition at line 76 of file mempool_entry.h.

◆ nUsageSize

const size_t CTxMemPoolEntry::nUsageSize
private

... and total memory usage

Definition at line 77 of file mempool_entry.h.

◆ sigOpCost

const int64_t CTxMemPoolEntry::sigOpCost
private

Total sigop cost.

Definition at line 82 of file mempool_entry.h.

◆ spendsCoinbase

const bool CTxMemPoolEntry::spendsCoinbase
private

keep track of transactions that spend a coinbase

Definition at line 81 of file mempool_entry.h.

◆ tx

const CTransactionRef CTxMemPoolEntry::tx
private

Definition at line 74 of file mempool_entry.h.


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