Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.h
| Show First 20 Lines • Show All 281 Lines • ▼ Show 20 Lines | typedef boost::multi_index_container< | ||||
| CompareTxMemPoolEntryByEntryId>>> | CompareTxMemPoolEntryByEntryId>>> | ||||
| indexed_transaction_set; | indexed_transaction_set; | ||||
| /** | /** | ||||
| * This mutex needs to be locked when accessing `mapTx` or other members | * This mutex needs to be locked when accessing `mapTx` or other members | ||||
| * that are guarded by it. | * that are guarded by it. | ||||
| * | * | ||||
| * @par Consistency guarantees | * @par Consistency guarantees | ||||
| * | |||||
| * By design, it is guaranteed that: | * By design, it is guaranteed that: | ||||
| * | * | ||||
| * 1. Locking both `cs_main` and `mempool.cs` will give a view of mempool | * 1. Locking both `cs_main` and `mempool.cs` will give a view of mempool | ||||
| * that is consistent with current chain tip (`ActiveChain()` and | * that is consistent with current chain tip (`ActiveChain()` and | ||||
| * `CoinsTip()`) and is fully populated. Fully populated means that if | * `CoinsTip()`) and is fully populated. Fully populated means that if | ||||
| * the current active chain is missing transactions that were present in | * the current active chain is missing transactions that were present in | ||||
| * a previously active chain, all the missing transactions will have been | * a previously active chain, all the missing transactions will have been | ||||
| * re-added to the mempool and should be present if they meet size and | * re-added to the mempool and should be present if they meet size and | ||||
| ▲ Show 20 Lines • Show All 216 Lines • ▼ Show 20 Lines | Amount GetTotalFee() const EXCLUSIVE_LOCKS_REQUIRED(cs) { | ||||
| return m_total_fee; | return m_total_fee; | ||||
| } | } | ||||
| bool exists(const TxId &txid) const { | bool exists(const TxId &txid) const { | ||||
| LOCK(cs); | LOCK(cs); | ||||
| return mapTx.count(txid) != 0; | return mapTx.count(txid) != 0; | ||||
| } | } | ||||
| bool setAvalancheFinalized(const CTxMemPoolEntryRef &tx) | bool setAvalancheFinalized(const CTxMemPoolEntryRef &tx, | ||||
| std::vector<TxId> &finalizedTxIds) | |||||
| EXCLUSIVE_LOCKS_REQUIRED(cs); | EXCLUSIVE_LOCKS_REQUIRED(cs); | ||||
| bool isAvalancheFinalized(const TxId &txid) const { | bool isAvalancheFinalized(const TxId &txid) const { | ||||
| LOCK(cs); | LOCK(cs); | ||||
| return finalizedTxs.get(txid) != nullptr; | return finalizedTxs.get(txid) != nullptr; | ||||
| } | } | ||||
| CTransactionRef get(const TxId &txid) const; | CTransactionRef get(const TxId &txid) const; | ||||
| ▲ Show 20 Lines • Show All 141 Lines • Show Last 20 Lines | |||||