Bitcoin Core  0.15.99
P2P Digital Currency
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 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, int 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

CTransactionRef tx
 
CAmount nFee
 Cached to avoid expensive parent-transaction lookups. More...
 
size_t nTxWeight
 ... and avoid recomputing tx weight (also used for GetTxSize()) More...
 
size_t nUsageSize
 ... and total memory usage More...
 
int64_t nTime
 Local time when entering the mempool. More...
 
unsigned int entryHeight
 Chain height when entering the mempool. More...
 
bool spendsCoinbase
 keep track of transactions that spend a coinbase More...
 
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.

Definition at line 64 of file txmempool.h.

Constructor & Destructor Documentation

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

Definition at line 21 of file txmempool.cpp.

Here is the call graph for this function:

Member Function Documentation

size_t CTxMemPoolEntry::DynamicMemoryUsage ( ) const
inline

Definition at line 106 of file txmempool.h.

Here is the caller graph for this function:

uint64_t CTxMemPoolEntry::GetCountWithAncestors ( ) const
inline

Definition at line 125 of file txmempool.h.

Here is the caller graph for this function:

uint64_t CTxMemPoolEntry::GetCountWithDescendants ( ) const
inline

Definition at line 119 of file txmempool.h.

Here is the caller graph for this function:

const CAmount& CTxMemPoolEntry::GetFee ( ) const
inline

Definition at line 99 of file txmempool.h.

Here is the caller graph for this function:

unsigned int CTxMemPoolEntry::GetHeight ( ) const
inline

Definition at line 103 of file txmempool.h.

Here is the caller graph for this function:

const LockPoints& CTxMemPoolEntry::GetLockPoints ( ) const
inline

Definition at line 107 of file txmempool.h.

CAmount CTxMemPoolEntry::GetModFeesWithAncestors ( ) const
inline

Definition at line 127 of file txmempool.h.

Here is the caller graph for this function:

CAmount CTxMemPoolEntry::GetModFeesWithDescendants ( ) const
inline

Definition at line 121 of file txmempool.h.

Here is the caller graph for this function:

int64_t CTxMemPoolEntry::GetModifiedFee ( ) const
inline

Definition at line 105 of file txmempool.h.

Here is the caller graph for this function:

CTransactionRef CTxMemPoolEntry::GetSharedTx ( ) const
inline

Definition at line 98 of file txmempool.h.

Here is the caller graph for this function:

int64_t CTxMemPoolEntry::GetSigOpCost ( ) const
inline

Definition at line 104 of file txmempool.h.

int64_t CTxMemPoolEntry::GetSigOpCostWithAncestors ( ) const
inline

Definition at line 128 of file txmempool.h.

uint64_t CTxMemPoolEntry::GetSizeWithAncestors ( ) const
inline

Definition at line 126 of file txmempool.h.

Here is the caller graph for this function:

uint64_t CTxMemPoolEntry::GetSizeWithDescendants ( ) const
inline

Definition at line 120 of file txmempool.h.

Here is the caller graph for this function:

bool CTxMemPoolEntry::GetSpendsCoinbase ( ) const
inline

Definition at line 123 of file txmempool.h.

int64_t CTxMemPoolEntry::GetTime ( ) const
inline

Definition at line 102 of file txmempool.h.

Here is the caller graph for this function:

const CTransaction& CTxMemPoolEntry::GetTx ( ) const
inline

Definition at line 97 of file txmempool.h.

Here is the caller graph for this function:

size_t CTxMemPoolEntry::GetTxSize ( ) const

Definition at line 54 of file txmempool.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

size_t CTxMemPoolEntry::GetTxWeight ( ) const
inline

Definition at line 101 of file txmempool.h.

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

Definition at line 320 of file txmempool.cpp.

Here is the caller graph for this function:

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

Definition at line 311 of file txmempool.cpp.

Here is the caller graph for this function:

void CTxMemPoolEntry::UpdateFeeDelta ( int64_t  feeDelta)

Definition at line 42 of file txmempool.cpp.

Here is the caller graph for this function:

void CTxMemPoolEntry::UpdateLockPoints ( const LockPoints lp)

Definition at line 49 of file txmempool.cpp.

Here is the caller graph for this function:

Member Data Documentation

unsigned int CTxMemPoolEntry::entryHeight
private

Chain height when entering the mempool.

Definition at line 72 of file txmempool.h.

int64_t CTxMemPoolEntry::feeDelta
private

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

Definition at line 75 of file txmempool.h.

LockPoints CTxMemPoolEntry::lockPoints
private

Track the height and time at which tx was final.

Definition at line 76 of file txmempool.h.

uint64_t CTxMemPoolEntry::nCountWithAncestors
private

Definition at line 86 of file txmempool.h.

uint64_t CTxMemPoolEntry::nCountWithDescendants
private

number of descendant transactions

Definition at line 81 of file txmempool.h.

CAmount CTxMemPoolEntry::nFee
private

Cached to avoid expensive parent-transaction lookups.

Definition at line 68 of file txmempool.h.

CAmount CTxMemPoolEntry::nModFeesWithAncestors
private

Definition at line 88 of file txmempool.h.

CAmount CTxMemPoolEntry::nModFeesWithDescendants
private

... and total fees (all including us)

Definition at line 83 of file txmempool.h.

int64_t CTxMemPoolEntry::nSigOpCostWithAncestors
private

Definition at line 89 of file txmempool.h.

uint64_t CTxMemPoolEntry::nSizeWithAncestors
private

Definition at line 87 of file txmempool.h.

uint64_t CTxMemPoolEntry::nSizeWithDescendants
private

... and size

Definition at line 82 of file txmempool.h.

int64_t CTxMemPoolEntry::nTime
private

Local time when entering the mempool.

Definition at line 71 of file txmempool.h.

size_t CTxMemPoolEntry::nTxWeight
private

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

Definition at line 69 of file txmempool.h.

size_t CTxMemPoolEntry::nUsageSize
private

... and total memory usage

Definition at line 70 of file txmempool.h.

int64_t CTxMemPoolEntry::sigOpCost
private

Total sigop cost.

Definition at line 74 of file txmempool.h.

bool CTxMemPoolEntry::spendsCoinbase
private

keep track of transactions that spend a coinbase

Definition at line 73 of file txmempool.h.

CTransactionRef CTxMemPoolEntry::tx
private

Definition at line 67 of file txmempool.h.

size_t CTxMemPoolEntry::vTxHashesIdx
mutable

Index in mempool's vTxHashes.

Definition at line 130 of file txmempool.h.


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