Bitcoin
Public Member Functions | Public Attributes | Private Attributes | List of all members
CTxMemPoolEntry Class Reference

#include <txmempool.h>

Public Member Functions

 CTxMemPoolEntry (const CTransactionRef &_tx, const CAmount &_nFee, int64_t _nTime, unsigned int _entryHeight, bool spendsCoinbase, int64_t nSigOpsCost, LockPoints lp)
 
const CTransactionGetTx () const
 
CTransactionRef GetSharedTx () const
 
const CAmountGetFee () const
 
size_t GetTxSize () const
 
size_t GetTxWeight () const
 
int64_t GetTime () const
 
unsigned int GetHeight () const
 
int64_t GetSigOpCost () const
 
int64_t GetModifiedFee () const
 
size_t DynamicMemoryUsage () const
 
const LockPointsGetLockPoints () 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 UpdateFeeDelta (int64_t feeDelta)
 
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
 

Public Attributes

size_t vTxHashesIdx
 Index in mempool's vTxHashes. More...
 

Private Attributes

const CTransactionRef tx
 
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...
 
int64_t feeDelta
 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
 number of descendant transactions More...
 
uint64_t nSizeWithDescendants
 ... and size More...
 
CAmount nModFeesWithDescendants
 ... and total fees (all including us) More...
 
uint64_t nCountWithAncestors
 
uint64_t nSizeWithAncestors
 
CAmount nModFeesWithAncestors
 
int64_t nSigOpCostWithAncestors
 

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.

Constructor & Destructor Documentation

◆ CTxMemPoolEntry()

CTxMemPoolEntry::CTxMemPoolEntry ( const CTransactionRef _tx,
const CAmount _nFee,
int64_t  _nTime,
unsigned int  _entryHeight,
bool  spendsCoinbase,
int64_t  nSigOpsCost,
LockPoints  lp 
)

Member Function Documentation

◆ DynamicMemoryUsage()

size_t CTxMemPoolEntry::DynamicMemoryUsage ( ) const
inline

◆ GetCountWithAncestors()

uint64_t CTxMemPoolEntry::GetCountWithAncestors ( ) const
inline

◆ GetCountWithDescendants()

uint64_t CTxMemPoolEntry::GetCountWithDescendants ( ) const
inline

◆ GetFee()

const CAmount& CTxMemPoolEntry::GetFee ( ) const
inline

◆ GetHeight()

unsigned int CTxMemPoolEntry::GetHeight ( ) const
inline

◆ GetLockPoints()

const LockPoints& CTxMemPoolEntry::GetLockPoints ( ) const
inline

◆ GetModFeesWithAncestors()

CAmount CTxMemPoolEntry::GetModFeesWithAncestors ( ) const
inline

◆ GetModFeesWithDescendants()

CAmount CTxMemPoolEntry::GetModFeesWithDescendants ( ) const
inline

◆ GetModifiedFee()

int64_t CTxMemPoolEntry::GetModifiedFee ( ) const
inline

◆ GetSharedTx()

CTransactionRef CTxMemPoolEntry::GetSharedTx ( ) const
inline

◆ GetSigOpCost()

int64_t CTxMemPoolEntry::GetSigOpCost ( ) const
inline

◆ GetSigOpCostWithAncestors()

int64_t CTxMemPoolEntry::GetSigOpCostWithAncestors ( ) const
inline

◆ GetSizeWithAncestors()

uint64_t CTxMemPoolEntry::GetSizeWithAncestors ( ) const
inline

◆ GetSizeWithDescendants()

uint64_t CTxMemPoolEntry::GetSizeWithDescendants ( ) const
inline

◆ GetSpendsCoinbase()

bool CTxMemPoolEntry::GetSpendsCoinbase ( ) const
inline

◆ GetTime()

int64_t CTxMemPoolEntry::GetTime ( ) const
inline

◆ GetTx()

const CTransaction& CTxMemPoolEntry::GetTx ( ) const
inline

◆ GetTxSize()

size_t CTxMemPoolEntry::GetTxSize ( ) const

◆ GetTxWeight()

size_t CTxMemPoolEntry::GetTxWeight ( ) const
inline

◆ UpdateAncestorState()

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

◆ UpdateDescendantState()

void CTxMemPoolEntry::UpdateDescendantState ( int64_t  modifySize,
CAmount  modifyFee,
int64_t  modifyCount 
)

◆ UpdateFeeDelta()

void CTxMemPoolEntry::UpdateFeeDelta ( int64_t  feeDelta)

◆ UpdateLockPoints()

void CTxMemPoolEntry::UpdateLockPoints ( const LockPoints lp)

Member Data Documentation

◆ entryHeight

const unsigned int CTxMemPoolEntry::entryHeight
private

Chain height when entering the mempool.

◆ feeDelta

int64_t CTxMemPoolEntry::feeDelta
private

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

◆ lockPoints

LockPoints CTxMemPoolEntry::lockPoints
private

Track the height and time at which tx was final.

◆ nCountWithAncestors

uint64_t CTxMemPoolEntry::nCountWithAncestors
private

◆ nCountWithDescendants

uint64_t CTxMemPoolEntry::nCountWithDescendants
private

number of descendant transactions

◆ nFee

const CAmount CTxMemPoolEntry::nFee
private

Cached to avoid expensive parent-transaction lookups.

◆ nModFeesWithAncestors

CAmount CTxMemPoolEntry::nModFeesWithAncestors
private

◆ nModFeesWithDescendants

CAmount CTxMemPoolEntry::nModFeesWithDescendants
private

... and total fees (all including us)

◆ nSigOpCostWithAncestors

int64_t CTxMemPoolEntry::nSigOpCostWithAncestors
private

◆ nSizeWithAncestors

uint64_t CTxMemPoolEntry::nSizeWithAncestors
private

◆ nSizeWithDescendants

uint64_t CTxMemPoolEntry::nSizeWithDescendants
private

... and size

◆ nTime

const int64_t CTxMemPoolEntry::nTime
private

Local time when entering the mempool.

◆ nTxWeight

const size_t CTxMemPoolEntry::nTxWeight
private

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

◆ nUsageSize

const size_t CTxMemPoolEntry::nUsageSize
private

... and total memory usage

◆ sigOpCost

const int64_t CTxMemPoolEntry::sigOpCost
private

Total sigop cost.

◆ spendsCoinbase

const bool CTxMemPoolEntry::spendsCoinbase
private

keep track of transactions that spend a coinbase

◆ tx

const CTransactionRef CTxMemPoolEntry::tx
private

◆ vTxHashesIdx

size_t CTxMemPoolEntry::vTxHashesIdx
mutable

Index in mempool's vTxHashes.


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