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

Public Member Functions

 ConnectTrace (CTxMemPool &_pool)
 
void BlockConnected (CBlockIndex *pindex, std::shared_ptr< const CBlock > pblock)
 
std::vector< PerBlockConnectTrace > & GetBlocksConnected ()
 
void NotifyEntryRemoved (CTransactionRef txRemoved, MemPoolRemovalReason reason)
 

Private Attributes

std::vector< PerBlockConnectTraceblocksConnected
 
CTxMemPoolpool
 
boost::signals2::scoped_connection m_connNotifyEntryRemoved
 

Detailed Description

Used to track blocks whose transactions were applied to the UTXO state as a part of a single ActivateBestChainStep call.

This class also tracks transactions that are removed from the mempool as conflicts (per block) and can be used to pass all those transactions through SyncTransaction.

This class assumes (and asserts) that the conflicted transactions for a given block are added via mempool callbacks prior to the BlockConnected() associated with those transactions. If any transactions are marked conflicted, it is assumed that an associated block will always be added.

This class is single-use, once you call GetBlocksConnected() you have to throw it away and make a new one.

Constructor & Destructor Documentation

◆ ConnectTrace()

ConnectTrace::ConnectTrace ( CTxMemPool _pool)
inlineexplicit

Member Function Documentation

◆ BlockConnected()

void ConnectTrace::BlockConnected ( CBlockIndex pindex,
std::shared_ptr< const CBlock pblock 
)
inline

◆ GetBlocksConnected()

std::vector<PerBlockConnectTrace>& ConnectTrace::GetBlocksConnected ( )
inline

◆ NotifyEntryRemoved()

void ConnectTrace::NotifyEntryRemoved ( CTransactionRef  txRemoved,
MemPoolRemovalReason  reason 
)
inline

Member Data Documentation

◆ blocksConnected

std::vector<PerBlockConnectTrace> ConnectTrace::blocksConnected
private

◆ m_connNotifyEntryRemoved

boost::signals2::scoped_connection ConnectTrace::m_connNotifyEntryRemoved
private

◆ pool

CTxMemPool& ConnectTrace::pool
private

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