Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.h
Show First 20 Lines • Show All 506 Lines • ▼ Show 20 Lines | private: | ||||
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; | ||||
mutable uint64_t m_epoch; | mutable uint64_t m_epoch; | ||||
mutable bool m_has_epoch_guard; | mutable bool m_has_epoch_guard; | ||||
// In-memory counter for external mempool tracking purposes. | |||||
// This number is incremented once every time a transaction | |||||
// is added or removed from the mempool for any reason. | |||||
mutable uint64_t m_sequence_number{1}; | |||||
void trackPackageRemoved(const CFeeRate &rate) EXCLUSIVE_LOCKS_REQUIRED(cs); | void trackPackageRemoved(const CFeeRate &rate) EXCLUSIVE_LOCKS_REQUIRED(cs); | ||||
bool m_is_loaded GUARDED_BY(cs){false}; | bool m_is_loaded GUARDED_BY(cs){false}; | ||||
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; | ||||
▲ Show 20 Lines • Show All 292 Lines • ▼ Show 20 Lines | public: | ||||
} | } | ||||
/** Returns whether a txid is in the unbroadcast set */ | /** Returns whether a txid is in the unbroadcast set */ | ||||
bool IsUnbroadcastTx(const TxId &txid) const EXCLUSIVE_LOCKS_REQUIRED(cs) { | bool IsUnbroadcastTx(const TxId &txid) const EXCLUSIVE_LOCKS_REQUIRED(cs) { | ||||
AssertLockHeld(cs); | AssertLockHeld(cs); | ||||
return (m_unbroadcast_txids.count(txid) != 0); | return (m_unbroadcast_txids.count(txid) != 0); | ||||
} | } | ||||
/** Guards this internal counter for external reporting */ | |||||
uint64_t GetAndIncrementSequence() const EXCLUSIVE_LOCKS_REQUIRED(cs) { | |||||
return m_sequence_number++; | |||||
} | |||||
uint64_t GetSequence() const EXCLUSIVE_LOCKS_REQUIRED(cs) { | |||||
return m_sequence_number; | |||||
} | |||||
private: | private: | ||||
/** | /** | ||||
* UpdateForDescendants is used by UpdateTransactionsFromBlock to update the | * UpdateForDescendants is used by UpdateTransactionsFromBlock to update the | ||||
* descendants for a single transaction that has been added to the mempool | * descendants for a single transaction that has been added to the mempool | ||||
* but may have child transactions in the mempool, eg during a chain reorg. | * but may have child transactions in the mempool, eg during a chain reorg. | ||||
* setExclude is the set of descendant transactions in the mempool that must | * setExclude is the set of descendant transactions in the mempool that must | ||||
* not be accounted for (because any descendants in setExclude were added to | * not be accounted for (because any descendants in setExclude were added to | ||||
* the mempool after the transaction being updated and hence their state is | * the mempool after the transaction being updated and hence their state is | ||||
▲ Show 20 Lines • Show All 239 Lines • Show Last 20 Lines |