Bitcoin ABC  0.24.7
P2P Digital Currency
Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
DisconnectedBlockTransactions Class Reference

#include <txmempool.h>

Public Member Functions

 ~DisconnectedBlockTransactions ()
 
size_t DynamicMemoryUsage () const
 
const indexed_disconnected_transactionsGetQueuedTx () const
 
void importMempool (CTxMemPool &pool) EXCLUSIVE_LOCKS_REQUIRED(pool.cs)
 
void addForBlock (const std::vector< CTransactionRef > &vtx, CTxMemPool &pool) EXCLUSIVE_LOCKS_REQUIRED(pool.cs)
 
void removeForBlock (const std::vector< CTransactionRef > &vtx)
 
void removeEntry (indexed_disconnected_transactions::index< insertion_order >::type::iterator entry)
 
bool isEmpty () const
 
void clear ()
 
void updateMempoolForReorg (const Config &config, bool fAddToMempool, CTxMemPool &pool) EXCLUSIVE_LOCKS_REQUIRED(cs_main
 Make mempool consistent after a reorg, by re-adding or recursively erasing disconnected block transactions from the mempool, and also removing any other transactions from the mempool that are no longer valid given the new tip/height. More...
 

Public Attributes

void pool cs
 

Private Types

typedef boost::multi_index_container< CTransactionRef, boost::multi_index::indexed_by< boost::multi_index::hashed_unique< boost::multi_index::tag< txid_index >, mempoolentry_txid, SaltedTxIdHasher >, boost::multi_index::sequenced< boost::multi_index::tag< insertion_order > > > > indexed_disconnected_transactions
 

Private Member Functions

void addTransaction (const CTransactionRef &tx)
 

Private Attributes

indexed_disconnected_transactions queuedTx
 
uint64_t cachedInnerUsage = 0
 

Detailed Description

Definition at line 981 of file txmempool.h.

Member Typedef Documentation

◆ indexed_disconnected_transactions

typedef boost::multi_index_container< CTransactionRef, boost::multi_index::indexed_by< boost::multi_index::hashed_unique< boost::multi_index::tag<txid_index>, mempoolentry_txid, SaltedTxIdHasher>, boost::multi_index::sequenced< boost::multi_index::tag<insertion_order> > > > DisconnectedBlockTransactions::indexed_disconnected_transactions
private

Definition at line 992 of file txmempool.h.

Constructor & Destructor Documentation

◆ ~DisconnectedBlockTransactions()

DisconnectedBlockTransactions::~DisconnectedBlockTransactions ( )
inline

Definition at line 1011 of file txmempool.h.

Member Function Documentation

◆ addForBlock()

void DisconnectedBlockTransactions::addForBlock ( const std::vector< CTransactionRef > &  vtx,
CTxMemPool pool 
)

Definition at line 1304 of file txmempool.cpp.

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

◆ addTransaction()

void DisconnectedBlockTransactions::addTransaction ( const CTransactionRef tx)
inlineprivate

Definition at line 997 of file txmempool.h.

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

◆ clear()

void DisconnectedBlockTransactions::clear ( )
inline

Definition at line 1060 of file txmempool.h.

Here is the caller graph for this function:

◆ DynamicMemoryUsage()

size_t DisconnectedBlockTransactions::DynamicMemoryUsage ( ) const
inline

Definition at line 1015 of file txmempool.h.

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

◆ GetQueuedTx()

const indexed_disconnected_transactions& DisconnectedBlockTransactions::GetQueuedTx ( ) const
inline

Definition at line 1022 of file txmempool.h.

Here is the caller graph for this function:

◆ importMempool()

void DisconnectedBlockTransactions::importMempool ( CTxMemPool pool)

Definition at line 1363 of file txmempool.cpp.

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

◆ isEmpty()

bool DisconnectedBlockTransactions::isEmpty ( ) const
inline

Definition at line 1058 of file txmempool.h.

Here is the caller graph for this function:

◆ removeEntry()

void DisconnectedBlockTransactions::removeEntry ( indexed_disconnected_transactions::index< insertion_order >::type::iterator  entry)
inline

Definition at line 1052 of file txmempool.h.

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

◆ removeForBlock()

void DisconnectedBlockTransactions::removeForBlock ( const std::vector< CTransactionRef > &  vtx)
inline

Definition at line 1037 of file txmempool.h.

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

◆ updateMempoolForReorg()

void DisconnectedBlockTransactions::updateMempoolForReorg ( const Config config,
bool  fAddToMempool,
CTxMemPool pool 
)

Make mempool consistent after a reorg, by re-adding or recursively erasing disconnected block transactions from the mempool, and also removing any other transactions from the mempool that are no longer valid given the new tip/height.

Note: we assume that disconnectpool only contains transactions that are NOT confirmed in the current chain nor already in the mempool (otherwise, in-mempool descendants of such transactions would be removed).

Passing fAddToMempool=false will skip trying to add the transactions back, and instead just erase from the mempool as needed.

Definition at line 1399 of file txmempool.cpp.

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

Member Data Documentation

◆ cachedInnerUsage

uint64_t DisconnectedBlockTransactions::cachedInnerUsage = 0
private

Definition at line 995 of file txmempool.h.

◆ cs

void pool DisconnectedBlockTransactions::cs

Definition at line 1080 of file txmempool.h.

◆ queuedTx

indexed_disconnected_transactions DisconnectedBlockTransactions::queuedTx
private

Definition at line 994 of file txmempool.h.


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