Bitcoin ABC 0.26.3
P2P Digital Currency
|
#include <disconnected_transactions.h>
Classes | |
struct | TxInfo |
Public Member Functions | |
~DisconnectedBlockTransactions () | |
size_t | DynamicMemoryUsage () const |
const indexed_disconnected_transactions & | GetQueuedTx () 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 | removeForBlock (const std::vector< CTransactionRef > &vtx, CTxMemPool &pool) EXCLUSIVE_LOCKS_REQUIRED(pool.cs) |
void | removeEntry (indexed_disconnected_transactions::index< insertion_order >::type::iterator entry) |
bool | isEmpty () const |
void | clear () |
void | updateMempoolForReorg (Chainstate &active_chainstate, 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. | |
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 |
using | TxInfoMap = std::unordered_map< TxId, TxInfo, SaltedTxIdHasher > |
Private Member Functions | |
void | addTransaction (const CTransactionRef &tx) |
const TxInfo * | getTxInfo (const CTransactionRef &tx) const |
Private Attributes | |
indexed_disconnected_transactions | queuedTx |
uint64_t | cachedInnerUsage = 0 |
TxInfoMap | txInfo |
populated by importMempool(); the original tx entry times and feeDeltas | |
Definition at line 45 of file disconnected_transactions.h.
|
private |
Definition at line 56 of file disconnected_transactions.h.
|
private |
Definition at line 70 of file disconnected_transactions.h.
|
inline |
Definition at line 93 of file disconnected_transactions.h.
void DisconnectedBlockTransactions::addForBlock | ( | const std::vector< CTransactionRef > & | vtx, |
CTxMemPool & | pool | ||
) |
Definition at line 81 of file disconnected_transactions.cpp.
|
inlineprivate |
Definition at line 74 of file disconnected_transactions.h.
|
inline |
Definition at line 147 of file disconnected_transactions.h.
|
inline |
Definition at line 97 of file disconnected_transactions.h.
|
inline |
Definition at line 104 of file disconnected_transactions.h.
|
private |
Definition at line 20 of file disconnected_transactions.cpp.
void DisconnectedBlockTransactions::importMempool | ( | CTxMemPool & | pool | ) |
Definition at line 28 of file disconnected_transactions.cpp.
|
inline |
Definition at line 145 of file disconnected_transactions.h.
|
inline |
Definition at line 138 of file disconnected_transactions.h.
|
inline |
Definition at line 119 of file disconnected_transactions.h.
void DisconnectedBlockTransactions::removeForBlock | ( | const std::vector< CTransactionRef > & | vtx, |
CTxMemPool & | pool | ||
) |
Definition at line 140 of file disconnected_transactions.cpp.
void DisconnectedBlockTransactions::updateMempoolForReorg | ( | Chainstate & | active_chainstate, |
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 174 of file disconnected_transactions.cpp.
|
private |
Definition at line 59 of file disconnected_transactions.h.
void pool DisconnectedBlockTransactions::cs |
Definition at line 168 of file disconnected_transactions.h.
|
private |
Definition at line 58 of file disconnected_transactions.h.
|
private |
populated by importMempool(); the original tx entry times and feeDeltas
Definition at line 72 of file disconnected_transactions.h.