Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.h
Show First 20 Lines • Show All 496 Lines • ▼ Show 20 Lines | private: | ||||
//! themselves) | //! themselves) | ||||
uint64_t cachedInnerUsage; | uint64_t cachedInnerUsage; | ||||
mutable int64_t lastRollingFeeUpdate; | mutable int64_t lastRollingFeeUpdate; | ||||
mutable bool blockSinceLastRollingFeeBump; | mutable bool blockSinceLastRollingFeeBump; | ||||
//!< minimum fee to get into the pool, decreases exponentially | //!< minimum fee to get into the pool, decreases exponentially | ||||
mutable double rollingMinimumFeeRate; | mutable double rollingMinimumFeeRate; | ||||
void trackPackageRemoved(const CFeeRate &rate); | void trackPackageRemoved(const CFeeRate &rate) EXCLUSIVE_LOCKS_REQUIRED(cs); | ||||
public: | public: | ||||
// public only for testing | // public only for testing | ||||
static const int ROLLING_FEE_HALFLIFE = 60 * 60 * 12; | static const int ROLLING_FEE_HALFLIFE = 60 * 60 * 12; | ||||
typedef boost::multi_index_container< | typedef boost::multi_index_container< | ||||
CTxMemPoolEntry, boost::multi_index::indexed_by< | CTxMemPoolEntry, boost::multi_index::indexed_by< | ||||
// sorted by txid | // sorted by txid | ||||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | private: | ||||
typedef std::map<txiter, TxLinks, CompareIteratorByHash> txlinksMap; | typedef std::map<txiter, TxLinks, CompareIteratorByHash> txlinksMap; | ||||
txlinksMap mapLinks; | txlinksMap mapLinks; | ||||
void UpdateParent(txiter entry, txiter parent, bool add); | void UpdateParent(txiter entry, txiter parent, bool add); | ||||
void UpdateChild(txiter entry, txiter child, bool add); | void UpdateChild(txiter entry, txiter child, bool add); | ||||
std::vector<indexed_transaction_set::const_iterator> | std::vector<indexed_transaction_set::const_iterator> | ||||
GetSortedDepthAndScore() const; | GetSortedDepthAndScore() const EXCLUSIVE_LOCKS_REQUIRED(cs); | ||||
public: | public: | ||||
indirectmap<COutPoint, const CTransaction *> mapNextTx; | indirectmap<COutPoint, const CTransaction *> mapNextTx; | ||||
std::map<uint256, TXModifier> mapDeltas; | std::map<uint256, TXModifier> mapDeltas; | ||||
/** Create a new CTxMemPool. | /** Create a new CTxMemPool. | ||||
*/ | */ | ||||
CTxMemPool(); | CTxMemPool(); | ||||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | public: | ||||
* Remove a set of transactions from the mempool. If a transaction is in | * Remove a set of transactions from the mempool. If a transaction is in | ||||
* this set, then all in-mempool descendants must also be in the set, unless | * this set, then all in-mempool descendants must also be in the set, unless | ||||
* this transaction is being removed for being in a block. Set | * this transaction is being removed for being in a block. Set | ||||
* updateDescendants to true when removing a tx that was in a block, so that | * updateDescendants to true when removing a tx that was in a block, so that | ||||
* any in-mempool descendants have their ancestor state updated. | * any in-mempool descendants have their ancestor state updated. | ||||
*/ | */ | ||||
void | void | ||||
RemoveStaged(setEntries &stage, bool updateDescendants, | RemoveStaged(setEntries &stage, bool updateDescendants, | ||||
MemPoolRemovalReason reason = MemPoolRemovalReason::UNKNOWN); | MemPoolRemovalReason reason = MemPoolRemovalReason::UNKNOWN) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs); | |||||
/** | /** | ||||
* When adding transactions from a disconnected block back to the mempool, | * When adding transactions from a disconnected block back to the mempool, | ||||
* new mempool entries may have children in the mempool (which is generally | * new mempool entries may have children in the mempool (which is generally | ||||
* not the case when otherwise adding transactions). | * not the case when otherwise adding transactions). | ||||
* UpdateTransactionsFromBlock() will find child transactions and update the | * UpdateTransactionsFromBlock() will find child transactions and update the | ||||
* descendant state for each transaction in txidsToUpdate (excluding any | * descendant state for each transaction in txidsToUpdate (excluding any | ||||
* child transactions present in txidsToUpdate, which are already accounted | * child transactions present in txidsToUpdate, which are already accounted | ||||
▲ Show 20 Lines • Show All 293 Lines • Show Last 20 Lines |