Changeset View
Changeset View
Standalone View
Standalone View
src/txmempool.h
Show First 20 Lines • Show All 348 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
// Multi_index tag names | // Multi_index tag names | ||||
struct descendant_score {}; | struct descendant_score {}; | ||||
struct entry_time {}; | struct entry_time {}; | ||||
struct mining_score {}; | struct mining_score {}; | ||||
struct ancestor_score {}; | struct ancestor_score {}; | ||||
class CBlockPolicyEstimator; | |||||
/** | /** | ||||
* Information about a mempool transaction. | * Information about a mempool transaction. | ||||
*/ | */ | ||||
struct TxMempoolInfo { | struct TxMempoolInfo { | ||||
/** The transaction itself */ | /** The transaction itself */ | ||||
CTransactionRef tx; | CTransactionRef tx; | ||||
/** Time the transaction entered the mempool. */ | /** Time the transaction entered the mempool. */ | ||||
▲ Show 20 Lines • Show All 122 Lines • ▼ Show 20 Lines | |||||
* entry as "dirty", and set the feerate for sorting purposes to be equal the | * entry as "dirty", and set the feerate for sorting purposes to be equal the | ||||
* feerate of the transaction without any descendants. | * feerate of the transaction without any descendants. | ||||
*/ | */ | ||||
class CTxMemPool { | class CTxMemPool { | ||||
private: | private: | ||||
//!< Value n means that n times in 2^32 we check. | //!< Value n means that n times in 2^32 we check. | ||||
uint32_t nCheckFrequency; | uint32_t nCheckFrequency; | ||||
unsigned int nTransactionsUpdated; | unsigned int nTransactionsUpdated; | ||||
CBlockPolicyEstimator *minerPolicyEstimator; | |||||
//!< sum of all mempool tx's virtual sizes. | //!< sum of all mempool tx's virtual sizes. | ||||
uint64_t totalTxSize; | uint64_t totalTxSize; | ||||
//!< sum of dynamic memory usage of all the map elements (NOT the maps | //!< sum of dynamic memory usage of all the map elements (NOT the maps | ||||
//! themselves) | //! themselves) | ||||
uint64_t cachedInnerUsage; | uint64_t cachedInnerUsage; | ||||
mutable int64_t lastRollingFeeUpdate; | mutable int64_t lastRollingFeeUpdate; | ||||
▲ Show 20 Lines • Show All 245 Lines • ▼ Show 20 Lines | public: | ||||
* where one can be given. | * where one can be given. | ||||
*/ | */ | ||||
CFeeRate estimateSmartFee(int nBlocks, | CFeeRate estimateSmartFee(int nBlocks, | ||||
int *answerFoundAtBlocks = nullptr) const; | int *answerFoundAtBlocks = nullptr) const; | ||||
/** Estimate fee rate needed to get into the next nBlocks */ | /** Estimate fee rate needed to get into the next nBlocks */ | ||||
CFeeRate estimateFee(int nBlocks) const; | CFeeRate estimateFee(int nBlocks) const; | ||||
/** Write/Read estimates to disk */ | |||||
bool WriteFeeEstimates(CAutoFile &fileout) const; | |||||
bool ReadFeeEstimates(CAutoFile &filein); | |||||
size_t DynamicMemoryUsage() const; | size_t DynamicMemoryUsage() const; | ||||
boost::signals2::signal<void(CTransactionRef)> NotifyEntryAdded; | boost::signals2::signal<void(CTransactionRef)> NotifyEntryAdded; | ||||
boost::signals2::signal<void(CTransactionRef, MemPoolRemovalReason)> | boost::signals2::signal<void(CTransactionRef, MemPoolRemovalReason)> | ||||
NotifyEntryRemoved; | NotifyEntryRemoved; | ||||
private: | private: | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 181 Lines • Show Last 20 Lines |