The node's memory pool of unconfirmed transactions.
Synopsis
Declared in <txmempool.h>
class CTxMemPool;
Types
Name |
Description |
Stages a batch of mempool additions and associated removals to be applied atomically. |
|
Prioritisation information for a single entry in mapDeltas. |
Type Aliases
Name |
Description |
Cluster size and count limits applied to the mempool. |
|
Configuration options controlling mempool behavior and limits. |
|
Boost multi‐index container type storing mempool entries indexed by txid, wtxid, and entry time. |
|
A set of mempool iterators ordered by transaction hash. |
|
Const iterator into mapTx over the txid‐ordered index. |
Member Functions
Name |
Description |
|
Create a new CTxMemPool. Sanity checks will be off by default for performance, because otherwise accepting transactions becomes O(Nˆ2) where N is the number of transactions in the pool. |
Increase the transaction update counter by the given amount. |
|
Adds a transaction to the unbroadcast set |
|
Add the stored fee delta for the given txid to the supplied fee value. |
|
Compute the count, aggregate size, and aggregate fee of an entry's in‐mempool ancestors. |
|
Compute the count, aggregate size, and aggregate fee of an entry's in‐mempool descendants. |
|
|
|
Calculate all in‐mempool ancestors of entry (not including the tx itself) |
|
Check whether the given transaction would satisfy the mempool's cluster policy limits. |
|
Remove any stored fee delta for the given txid. |
|
Returns the dynamic memory usage of the mempool, in bytes. |
|
Expire all transaction (and their dependencies) in the mempool older than time. Return the number of removed transactions. |
|
Look up wtxids in the mempool and (partially) sort by mining score. |
|
Collect the entire cluster of connected transactions for each transaction in txids. All txids must correspond to transaction entries in the mempool, otherwise this returns an empty vector. This call will also exit early and return an empty vector if it collects 500 or more transactions as a DoS protection. |
|
Returns the number of in‐mempool ancestors of the given entry (including itself). |
|
Guards this internal counter for external reporting |
|
Retrieve the current chunk of transactions from the block builder in mining order. |
|
Create the single outstanding changeset for staging mempool additions and removals. |
|
Returns the direct in‐mempool children of the given entry. |
|
Returns all mempool entries in the same cluster as the given transaction. |
|
Get the transaction in the pool that spends the same prevout |
|
|
|
Returns a pointer to the mempool entry for the given txid, or nullptr if absent. |
|
Returns the mempool's fee‐rate diagram, i.e. the chunk fee rates in mining order. |
|
|
|
Translate a set of hashes into a set of pool iterators to avoid repeated lookups. Does not require that all of the hashes correspond to actual transactions in the mempool, only returns the ones that exist. |
|
Translate a list of hashes into a list of mempool iterators to avoid repeated lookups. The nth element in txids becomes the nth element in the returned vector. If any of the txids don't actually exist in the mempool, returns an empty vector. |
|
Report whether an initial attempt to load the persisted mempool was made. |
|
Returns the fee rate of the chunk containing the given entry in the main graph. |
|
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. |
|
Returns the direct in‐mempool parents of the given entry. |
|
Return a vector of all entries in mapDeltas with their corresponding delta_info. |
|
Returns the current mempool sequence number without incrementing it. |
|
Returns the sum of base fees of all mempool transactions. |
|
Returns the sum of virtual sizes of all mempool transactions. |
|
Calculate the ancestor and cluster count for the given transaction. The counts include the transaction itself. When ancestors is non‐zero (ie, the transaction itself is in the mempool), ancestorsize and ancestorfees will also be set to the appropriate values. |
|
Returns the running count of transaction updates, used to trigger block template regeneration. |
|
Returns transactions in unbroadcast set |
|
Returns the number of distinct clusters spanned by the given set of entries. |
|
Returns whether the transaction with the given txid has any in‐mempool descendants. |
|
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. |
|
Include the current chunk in the block being built and advance the builder. |
|
Returns whether a txid is in the unbroadcast set |
|
Affect CreateNewBlock prioritisation of transactions |
|
Removes a transaction from the unbroadcast set |
|
Set whether or not an initial attempt to load the persisted mempool was made (regardless of whether the attempt was successful or not) |
|
Skip the current chunk without including it and advance the builder. |
|
Begin building a block by creating the block builder from the transaction graph. |
|
Finish block building and release the block builder. |
|
Remove transactions from the mempool until its dynamic size is <= sizelimit. pvNoSpendsRemaining, if set, will be populated with the list of outpoints which are not in mempool which no longer have any spends in this mempool. |
|
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). |
|
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). If sanity‐checking is turned off, check does nothing. |
|
Returns every mempool entry. |
|
|
|
|
|
Returns descriptive information about the transaction with the given hash. |
|
Returns descriptive information for every mempool transaction. |
|
Returns info for a transaction if its entry_sequence < last_sequence |
|
Returns whether the given outpoint is spent by a transaction in the mempool. |
|
Remove transactions confirmed in a block (and any that conflict with them) from the mempool. |
|
After reorg, filter the entries that would no longer be valid in the next block, and update the entries' cached LockPoints if needed. The mempool does not have any knowledge of consensus rules. It just applies the callable function and removes the ones for which it returns true. |
|
Remove a transaction from the mempool along with any descendants. If the transaction is not already in the mempool, find any descendants and remove them. |
|
Returns the number of transactions in the mempool. |
Data Members
Name |
Description |
This mutex needs to be locked when accessing |
|
Block builder used to iterate mempool chunks in mining order while assembling a block. |
|
Whether a changeset is currently outstanding against this mempool. |
|
The configuration options this mempool was constructed with. |
|
Transaction‐graph abstraction managing parent/child relationships, clusters, and ordering. |
|
Maps a txid to the fee delta applied to it via PrioritiseTransaction(). |
|
Maps each spent outpoint to the in‐mempool transaction that spends it. |
|
The multi‐index container holding every mempool entry. |
|
All transactions in mapTx with their wtxids, in arbitrary order |
Static Data Members
Name |
Description |
Half‐life, in seconds, of the exponential decay applied to the rolling minimum fee rate. |
Protected Member Functions
Name |
Description |
Compute the minimum fee rate to enter a mempool bounded by the given size limit. |
|
Update the rolling minimum fee rate to account for a package removal at the given fee rate. |
Protected Data Members
Name |
Description |
whether a block has been connected since the rolling fee was last bumped |
|
sum of dynamic memory usage of all the map elements (NOT the maps themselves) |
|
time the rolling minimum fee rate was last decayed |
|
whether an attempt to load the persisted mempool has been made |
|
In‐memory counter incremented every time a transaction is added to or removed from the mempool, used for external mempool tracking. |
|
sum of all mempool tx's fees (NOT modified fee) |
|
Used by getblocktemplate to trigger CreateNewBlock() invocation |
|
minimum fee to get into the pool, decreases exponentially |
|
sum of all mempool tx's virtual sizes. Differs from serialized tx size since witness data is discounted. Defined in BIP 141. |
Friends
Name |
Description |
Stages a batch of mempool additions and associated removals to be applied atomically. |
Non-Member Functions
Name |
Description |
Get the mempool from an opaque RPC context, asserting it is present. |
|
Get the mempool from a node context, asserting it is present. |
|
Mempool information to JSON |
|
Mempool to JSON |
|
Must be called for every transaction that is submitted within a package, even if not TRUC. |
|
Must be called for every transaction, even if not TRUC. Not strictly necessary for transactions accepted through AcceptMultipleTransactions. |
|
Dump the mempool to a file. |
|
Import the file and attempt to add its contents to the mempool. |
Created with MrDocs