Bitcoin Core  24.99.0
P2P Digital Currency
Public Member Functions | List of all members
MemPoolTest Class Referencefinal
Inheritance diagram for MemPoolTest:
Collaboration diagram for MemPoolTest:

Public Member Functions

CFeeRate GetMinFee (size_t sizelimit) const
CFeeRate GetMinFee () const
 The minimum fee to get into the mempool, which may itself not be enough for larger-sized transactions. More...
- Public Member Functions inherited from CTxMemPool
indexed_transaction_set mapTx GUARDED_BY (cs)
std::vector< std::pair< uint256, txiter > > vTxHashes GUARDED_BY (cs)
 All tx witness hashes/entries in mapTx, in random order. More...
uint64_t CalculateDescendantMaximum (txiter entry) const EXCLUSIVE_LOCKS_REQUIRED(cs)
indirectmap< COutPoint, const CTransaction * > mapNextTx GUARDED_BY (cs)
std::map< uint256, CAmount > mapDeltas GUARDED_BY (cs)
 CTxMemPool (const Options &opts)
 Create a new CTxMemPool. More...
void addUnchecked (const CTxMemPoolEntry &entry, setEntries &setAncestors, bool validFeeEstimate=true) EXCLUSIVE_LOCKS_REQUIRED(cs
void removeRecursive (const CTransaction &tx, MemPoolRemovalReason reason) EXCLUSIVE_LOCKS_REQUIRED(cs)
void removeForReorg (CChain &chain, std::function< bool(txiter)> filter_final_and_mature) EXCLUSIVE_LOCKS_REQUIRED(cs
 After reorg, filter the entries that would no longer be valid in the next block, and update the entries' cached LockPoints if needed. More...
void removeConflicts (const CTransaction &tx) EXCLUSIVE_LOCKS_REQUIRED(cs)
void removeForBlock (const std::vector< CTransactionRef > &vtx, unsigned int nBlockHeight) EXCLUSIVE_LOCKS_REQUIRED(cs)
 Called when a block is connected. More...
void clear ()
bool CompareDepthAndScore (const uint256 &hasha, const uint256 &hashb, bool wtxid=false)
void queryHashes (std::vector< uint256 > &vtxid) const
bool isSpent (const COutPoint &outpoint) const
unsigned int GetTransactionsUpdated () const
void AddTransactionsUpdated (unsigned int n)
bool HasNoInputsOf (const CTransaction &tx) const EXCLUSIVE_LOCKS_REQUIRED(cs)
 Check that none of this transactions inputs are in the mempool, and thus the tx is not dependent on other mempool transactions to be included in a block. More...
void PrioritiseTransaction (const uint256 &hash, const CAmount &nFeeDelta)
 Affect CreateNewBlock prioritisation of transactions. More...
void ApplyDelta (const uint256 &hash, CAmount &nFeeDelta) const EXCLUSIVE_LOCKS_REQUIRED(cs)
void ClearPrioritisation (const uint256 &hash) EXCLUSIVE_LOCKS_REQUIRED(cs)
const CTransactionGetConflictTx (const COutPoint &prevout) const EXCLUSIVE_LOCKS_REQUIRED(cs)
 Get the transaction in the pool that spends the same prevout. More...
std::optional< txiterGetIter (const uint256 &txid) const EXCLUSIVE_LOCKS_REQUIRED(cs)
 Returns an iterator to the given hash, if found. More...
setEntries GetIterSet (const std::set< uint256 > &hashes) const EXCLUSIVE_LOCKS_REQUIRED(cs)
 Translate a set of hashes into a set of pool iterators to avoid repeated lookups. More...
void RemoveStaged (setEntries &stage, bool updateDescendants, MemPoolRemovalReason reason) EXCLUSIVE_LOCKS_REQUIRED(cs)
 Remove a set of transactions from the mempool. More...
void UpdateTransactionsFromBlock (const std::vector< uint256 > &vHashesToUpdate) EXCLUSIVE_LOCKS_REQUIRED(cs
 UpdateTransactionsFromBlock is called when adding transactions from a disconnected block back to the mempool, new mempool entries may have children in the mempool (which is generally not the case when otherwise adding transactions). More...
void cs_main LOCKS_EXCLUDED (m_epoch)
bool CalculateMemPoolAncestors (const CTxMemPoolEntry &entry, setEntries &setAncestors, uint64_t limitAncestorCount, uint64_t limitAncestorSize, uint64_t limitDescendantCount, uint64_t limitDescendantSize, std::string &errString, bool fSearchForParents=true) const EXCLUSIVE_LOCKS_REQUIRED(cs)
 Try to calculate all in-mempool ancestors of entry. More...
bool CheckPackageLimits (const Package &package, uint64_t limitAncestorCount, uint64_t limitAncestorSize, uint64_t limitDescendantCount, uint64_t limitDescendantSize, std::string &errString) const EXCLUSIVE_LOCKS_REQUIRED(cs)
 Calculate all in-mempool ancestors of a set of transactions not already in the mempool and check ancestor and descendant limits. More...
void CalculateDescendants (txiter it, setEntries &setDescendants) const EXCLUSIVE_LOCKS_REQUIRED(cs)
 Populate setDescendants with all in-mempool descendants of hash. More...
CFeeRate GetMinFee () const
 The minimum fee to get into the mempool, which may itself not be enough for larger-sized transactions. More...
void TrimToSize (size_t sizelimit, std::vector< COutPoint > *pvNoSpendsRemaining=nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs)
 Remove transactions from the mempool until its dynamic size is <= sizelimit. More...
int Expire (std::chrono::seconds time) EXCLUSIVE_LOCKS_REQUIRED(cs)
 Expire all transaction (and their dependencies) in the mempool older than time. More...
void GetTransactionAncestry (const uint256 &txid, size_t &ancestors, size_t &descendants, size_t *ancestorsize=nullptr, CAmount *ancestorfees=nullptr) const
 Calculate the ancestor and descendant count for the given transaction. More...
bool GetLoadTried () const
void SetLoadTried (bool load_tried)
 Set whether or not we've made an attempt to load the mempool (regardless of whether the attempt was successful or not) More...
unsigned long size () const
uint64_t GetTotalTxSize () const EXCLUSIVE_LOCKS_REQUIRED(cs)
CAmount GetTotalFee () const EXCLUSIVE_LOCKS_REQUIRED(cs)
bool exists (const GenTxid &gtxid) const
CTransactionRef get (const uint256 &hash) const
txiter get_iter_from_wtxid (const uint256 &wtxid) const EXCLUSIVE_LOCKS_REQUIRED(cs)
TxMempoolInfo info (const GenTxid &gtxid) const
std::vector< TxMempoolInfoinfoAll () const
size_t DynamicMemoryUsage () const
void AddUnbroadcastTx (const uint256 &txid)
 Adds a transaction to the unbroadcast set. More...
void RemoveUnbroadcastTx (const uint256 &txid, const bool unchecked=false)
 Removes a transaction from the unbroadcast set. More...
std::set< uint256GetUnbroadcastTxs () const
 Returns transactions in unbroadcast set. More...
bool IsUnbroadcastTx (const uint256 &txid) const EXCLUSIVE_LOCKS_REQUIRED(cs)
 Returns whether a txid is in the unbroadcast set. More...
uint64_t GetAndIncrementSequence () const EXCLUSIVE_LOCKS_REQUIRED(cs)
 Guards this internal counter for external reporting. More...
uint64_t GetSequence () const EXCLUSIVE_LOCKS_REQUIRED(cs)
bool visited (const txiter it) const EXCLUSIVE_LOCKS_REQUIRED(cs
 visited marks a CTxMemPoolEntry as having been traversed during the lifetime of the most recently created Epoch::Guard and returns false if we are the first visitor, true otherwise. More...
bool visited (std::optional< txiter > it) const EXCLUSIVE_LOCKS_REQUIRED(cs

Additional Inherited Members

- Public Types inherited from CTxMemPool
typedef boost::multi_index_container< CTxMemPoolEntry, boost::multi_index::indexed_by< boost::multi_index::hashed_unique< mempoolentry_txid, SaltedTxidHasher >, boost::multi_index::hashed_unique< boost::multi_index::tag< index_by_wtxid >, mempoolentry_wtxid, SaltedTxidHasher >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< descendant_score >, boost::multi_index::identity< CTxMemPoolEntry >, CompareTxMemPoolEntryByDescendantScore >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< entry_time >, boost::multi_index::identity< CTxMemPoolEntry >, CompareTxMemPoolEntryByEntryTime >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< ancestor_score >, boost::multi_index::identity< CTxMemPoolEntry >, CompareTxMemPoolEntryByAncestorFee > > > indexed_transaction_set
using txiter = indexed_transaction_set::nth_index< 0 >::type::const_iterator
typedef std::set< txiter, CompareIteratorByHashsetEntries
using Options = kernel::MemPoolOptions
using Limits = kernel::MemPoolLimits
- Public Attributes inherited from CTxMemPool
RecursiveMutex cs
 This mutex needs to be locked when accessing mapTx or other members that are guarded by it. More...
const int64_t m_max_size_bytes
const std::chrono::seconds m_expiry
const CFeeRate m_incremental_relay_feerate
const CFeeRate m_min_relay_feerate
const CFeeRate m_dust_relay_feerate
const bool m_permit_bare_multisig
const std::optional< unsigned > m_max_datacarrier_bytes
const bool m_require_standard
const bool m_full_rbf
const Limits m_limits
void check(const CCoinsViewCache &active_coins_tip, int64_t spendheight) const EXCLUSIVE_LOCKS_REQUIRED(void addUnchecked (const CTxMemPoolEntry &entry, bool validFeeEstimate=true) EXCLUSIVE_LOCKS_REQUIRED(cs
 If sanity-checking is turned on, check makes sure the pool is consistent (does not contain two transactions that spend the same inputs, all inputs are in the mapNextTx array). More...
void check(const CCoinsViewCache &active_coins_tip, int64_t spendheight) const EXCLUSIVE_LOCKS_REQUIRED(void cs_main
void cs_main
bool m_epoch
return !it visitedit
- Static Public Attributes inherited from CTxMemPool
static const int ROLLING_FEE_HALFLIFE = 60 * 60 * 12
- Protected Member Functions inherited from CTxMemPool
uint64_t totalTxSize GUARDED_BY (cs)
 sum of all mempool tx's virtual sizes. Differs from serialized tx size since witness data is discounted. Defined in BIP 141. More...
CAmount m_total_fee GUARDED_BY (cs)
 sum of all mempool tx's fees (NOT modified fee) More...
uint64_t cachedInnerUsage GUARDED_BY (cs)
 sum of dynamic memory usage of all the map elements (NOT the maps themselves) More...
int64_t lastRollingFeeUpdate GUARDED_BY (cs)
bool blockSinceLastRollingFeeBump GUARDED_BY (cs)
double rollingMinimumFeeRate GUARDED_BY (cs)
 minimum fee to get into the pool, decreases exponentially More...
Epoch m_epoch GUARDED_BY (cs)
uint64_t m_sequence_number GUARDED_BY (cs)
void trackPackageRemoved (const CFeeRate &rate) EXCLUSIVE_LOCKS_REQUIRED(cs)
bool m_load_tried GUARDED_BY (cs)
CFeeRate GetMinFee (size_t sizelimit) const
- Protected Attributes inherited from CTxMemPool
const int m_check_ratio
 Value n means that 1 times in n we check. More...
std::atomic< unsigned int > nTransactionsUpdated {0}
 Used by getblocktemplate to trigger CreateNewBlock() invocation. More...
CBlockPolicyEstimator *const minerPolicyEstimator

Detailed Description

Definition at line 19 of file mempool_tests.cpp.

Member Function Documentation

◆ GetMinFee() [1/2]

CFeeRate CTxMemPool::GetMinFee

The minimum fee to get into the mempool, which may itself not be enough for larger-sized transactions.

The m_incremental_relay_feerate policy variable is used to bound the time it takes the fee rate to go back down all the way to 0. When the feerate would otherwise be half of this, it is set to 0 instead.

Definition at line 716 of file txmempool.h.

◆ GetMinFee() [2/2]

CFeeRate CTxMemPool::GetMinFee

Definition at line 456 of file txmempool.cpp.

The documentation for this class was generated from the following file: