Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the next block. More...
#include <txmempool.h>
Classes | |
struct | CompareIteratorByHash |
struct | TxLinks |
Public Types | |
typedef boost::multi_index_container< CTxMemPoolEntry, boost::multi_index::indexed_by< boost::multi_index::hashed_unique< mempoolentry_txid, 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 |
typedef indexed_transaction_set::nth_index< 0 >::type::iterator | txiter |
typedef std::set< txiter, CompareIteratorByHash > | setEntries |
Public Member Functions | |
const setEntries & | GetMemPoolParents (txiter entry) const |
const setEntries & | GetMemPoolChildren (txiter entry) const |
CTxMemPool (CBlockPolicyEstimator *estimator=nullptr) | |
Create a new CTxMemPool. More... | |
void | check (const CCoinsViewCache *pcoins) const |
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 | setSanityCheck (double dFrequency=1.0) |
bool | addUnchecked (const uint256 &hash, const CTxMemPoolEntry &entry, bool validFeeEstimate=true) |
bool | addUnchecked (const uint256 &hash, const CTxMemPoolEntry &entry, setEntries &setAncestors, bool validFeeEstimate=true) |
void | addAddressIndex (const CTxMemPoolEntry &entry, const CCoinsViewCache &view) |
bool | getAddressIndex (std::vector< std::pair< uint160, int > > &addresses, std::vector< std::pair< CMempoolAddressDeltaKey, CMempoolAddressDelta > > &results) |
bool | removeAddressIndex (const uint256 txhash) |
void | addSpentIndex (const CTxMemPoolEntry &entry, const CCoinsViewCache &view) |
bool | getSpentIndex (CSpentIndexKey &key, CSpentIndexValue &value) |
bool | removeSpentIndex (const uint256 txhash) |
void | removeRecursive (const CTransaction &tx, MemPoolRemovalReason reason=MemPoolRemovalReason::UNKNOWN) |
void | removeForReorg (const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags) |
void | removeConflicts (const CTransaction &tx) |
void | removeProTxPubKeyConflicts (const CTransaction &tx, const CKeyID &keyId) |
void | removeProTxPubKeyConflicts (const CTransaction &tx, const CBLSPublicKey &pubKey) |
void | removeProTxCollateralConflicts (const CTransaction &tx, const COutPoint &collateralOutpoint) |
void | removeProTxSpentCollateralConflicts (const CTransaction &tx) |
void | removeProTxKeyChangedConflicts (const CTransaction &tx, const uint256 &proTxHash, const uint256 &newKeyHash) |
void | removeProTxConflicts (const CTransaction &tx) |
void | removeForBlock (const std::vector< CTransactionRef > &vtx, unsigned int nBlockHeight) |
Called when a block is connected. More... | |
void | clear () |
void | _clear () |
bool | CompareDepthAndScore (const uint256 &hasha, const uint256 &hashb) |
void | queryHashes (std::vector< uint256 > &vtxid) |
bool | isSpent (const COutPoint &outpoint) |
unsigned int | GetTransactionsUpdated () const |
void | AddTransactionsUpdated (unsigned int n) |
bool | HasNoInputsOf (const CTransaction &tx) const |
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 |
void | ClearPrioritisation (const uint256 hash) |
void | RemoveStaged (setEntries &stage, bool updateDescendants, MemPoolRemovalReason reason=MemPoolRemovalReason::UNKNOWN) |
Remove a set of transactions from the mempool. More... | |
void | UpdateTransactionsFromBlock (const std::vector< uint256 > &vHashesToUpdate) |
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... | |
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 |
Try to calculate all in-mempool ancestors of entry. More... | |
void | CalculateDescendants (txiter it, setEntries &setDescendants) |
Populate setDescendants with all in-mempool descendants of hash. More... | |
CFeeRate | GetMinFee (size_t sizelimit) 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) |
Remove transactions from the mempool until its dynamic size is <= sizelimit. More... | |
int | Expire (int64_t time) |
Expire all transaction (and their dependencies) in the mempool older than time. More... | |
bool | TransactionWithinChainLimit (const uint256 &txid, size_t chainLimit) const |
Returns false if the transaction is in the mempool and not within the chain limit specified. More... | |
unsigned long | size () |
uint64_t | GetTotalTxSize () const |
bool | exists (uint256 hash) const |
CTransactionRef | get (const uint256 &hash) const |
TxMempoolInfo | info (const uint256 &hash) const |
std::vector< TxMempoolInfo > | infoAll () const |
bool | existsProviderTxConflict (const CTransaction &tx) const |
size_t | DynamicMemoryUsage () const |
Public Attributes | |
CCriticalSection | cs |
indexed_transaction_set | mapTx |
std::vector< std::pair< uint256, txiter > > | vTxHashes |
All tx hashes/entries in mapTx, in random order. More... | |
indirectmap< COutPoint, const CTransaction * > | mapNextTx |
std::map< uint256, CAmount > | mapDeltas |
boost::signals2::signal< void(CTransactionRef)> | NotifyEntryAdded |
boost::signals2::signal< void(CTransactionRef, MemPoolRemovalReason)> | NotifyEntryRemoved |
Static Public Attributes | |
static const int | ROLLING_FEE_HALFLIFE = 60 * 60 * 12 |
Private Types | |
typedef std::map< txiter, setEntries, CompareIteratorByHash > | cacheMap |
typedef std::map< txiter, TxLinks, CompareIteratorByHash > | txlinksMap |
typedef std::map< CMempoolAddressDeltaKey, CMempoolAddressDelta, CMempoolAddressDeltaKeyCompare > | addressDeltaMap |
typedef std::map< uint256, std::vector< CMempoolAddressDeltaKey > > | addressDeltaMapInserted |
typedef std::map< CSpentIndexKey, CSpentIndexValue, CSpentIndexKeyCompare > | mapSpentIndex |
typedef std::map< uint256, std::vector< CSpentIndexKey > > | mapSpentIndexInserted |
Private Member Functions | |
void | trackPackageRemoved (const CFeeRate &rate) |
void | UpdateParent (txiter entry, txiter parent, bool add) |
void | UpdateChild (txiter entry, txiter child, bool add) |
std::vector< indexed_transaction_set::const_iterator > | GetSortedDepthAndScore () const |
void | UpdateForDescendants (txiter updateIt, cacheMap &cachedDescendants, const std::set< uint256 > &setExclude) |
UpdateForDescendants is used by UpdateTransactionsFromBlock to update the 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. More... | |
void | UpdateAncestorsOf (bool add, txiter hash, setEntries &setAncestors) |
Update ancestors of hash to add/remove it as a descendant transaction. More... | |
void | UpdateEntryForAncestors (txiter it, const setEntries &setAncestors) |
Set ancestor state for an entry. More... | |
void | UpdateForRemoveFromMempool (const setEntries &entriesToRemove, bool updateDescendants) |
For each transaction being removed, update ancestors and any direct children. More... | |
void | UpdateChildrenForRemoval (txiter entry) |
Sever link between specified transaction and direct children. More... | |
void | removeUnchecked (txiter entry, MemPoolRemovalReason reason=MemPoolRemovalReason::UNKNOWN) |
Before calling removeUnchecked for a given transaction, UpdateForRemoveFromMempool must be called on the entire (dependent) set of transactions being removed at the same time. More... | |
Private Attributes | |
uint32_t | nCheckFrequency |
Value n means that n times in 2^32 we check. More... | |
unsigned int | nTransactionsUpdated |
Used by getblocktemplate to trigger CreateNewBlock() invocation. More... | |
CBlockPolicyEstimator * | minerPolicyEstimator |
uint64_t | totalTxSize |
sum of all mempool tx' byte sizes More... | |
uint64_t | cachedInnerUsage |
sum of dynamic memory usage of all the map elements (NOT the maps themselves) More... | |
int64_t | lastRollingFeeUpdate |
bool | blockSinceLastRollingFeeBump |
double | rollingMinimumFeeRate |
minimum fee to get into the pool, decreases exponentially More... | |
txlinksMap | mapLinks |
addressDeltaMap | mapAddress |
addressDeltaMapInserted | mapAddressInserted |
mapSpentIndex | mapSpent |
mapSpentIndexInserted | mapSpentInserted |
std::multimap< uint256, uint256 > | mapProTxRefs |
std::map< CService, uint256 > | mapProTxAddresses |
std::map< CKeyID, uint256 > | mapProTxPubKeyIDs |
std::map< uint256, uint256 > | mapProTxBlsPubKeyHashes |
std::map< COutPoint, uint256 > | mapProTxCollaterals |
Detailed Description
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the next block.
Transactions are added when they are seen on the network (or created by the local node), but not all transactions seen are added to the pool. For example, the following new transactions will not be added to the mempool:
- a transaction which doesn't meet the minimum fee requirements.
- a new transaction that double-spends an input of a transaction already in the pool.
- a non-standard transaction.
CTxMemPool::mapTx, and CTxMemPoolEntry bookkeeping:
mapTx is a boost::multi_index that sorts the mempool on 4 criteria:
- transaction hash
- feerate [we use max(feerate of tx, feerate of tx with all descendants)]
- time in mempool
Note: the term "descendant" refers to in-mempool transactions that depend on this one, while "ancestor" refers to in-mempool transactions that a given transaction depends on.
In order for the feerate sort to remain correct, we must update transactions in the mempool when new descendants arrive. To facilitate this, we track the set of in-mempool direct parents and direct children in mapLinks. Within each CTxMemPoolEntry, we track the size and fees of all descendants.
Usually when a new transaction is added to the mempool, it has no in-mempool children (because any such children would be an orphan). So in addUnchecked(), we:
- update a new entry's setMemPoolParents to include all in-mempool parents
- update the new entry's direct parents to include the new tx as a child
- update all ancestors of the transaction to include the new tx's size/fee
When a transaction is removed from the mempool, we must:
- update all in-mempool parents to not track the tx in setMemPoolChildren
- update all ancestors to not include the tx's size/fees in descendant state
- update all in-mempool children to not include it as a parent
These happen in UpdateForRemoveFromMempool(). (Note that when removing a transaction along with its descendants, we must calculate that set of transactions to be removed before doing the removal, or else the mempool can be in an inconsistent state where it's impossible to walk the ancestors of a transaction.)
In the event of a reorg, the assumption that a newly added tx has no in-mempool children is false. In particular, the mempool is in an inconsistent state while new transactions are being added, because there may be descendant transactions of a tx coming from a disconnected block that are unreachable from just looking at transactions in the mempool (the linking transactions may also be in the disconnected block, waiting to be added). Because of this, there's not much benefit in trying to search for in-mempool children in addUnchecked(). Instead, in the special case of transactions being added from a disconnected block, we require the caller to clean up the state, to account for in-mempool, out-of-block descendants for all the in-block transactions by calling UpdateTransactionsFromBlock(). Note that until this is called, the mempool state is not consistent, and in particular mapLinks may not be correct (and therefore functions like CalculateMemPoolAncestors() and CalculateDescendants() that rely on them to walk the mempool are not generally safe to use).
Computational limits:
Updating all in-mempool ancestors of a newly added transaction can be slow, if no bound exists on how many in-mempool ancestors there may be. CalculateMemPoolAncestors() takes configurable limits that are designed to prevent these calculations from being too CPU intensive.
Definition at line 442 of file txmempool.h.
Member Typedef Documentation
◆ addressDeltaMap
|
private |
Definition at line 514 of file txmempool.h.
◆ addressDeltaMapInserted
|
private |
Definition at line 517 of file txmempool.h.
◆ cacheMap
|
private |
Definition at line 504 of file txmempool.h.
◆ indexed_transaction_set
typedef boost::multi_index_container< CTxMemPoolEntry, boost::multi_index::indexed_by< boost::multi_index::hashed_unique<mempoolentry_txid, 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 > > > CTxMemPool::indexed_transaction_set |
Definition at line 486 of file txmempool.h.
◆ mapSpentIndex
|
private |
Definition at line 520 of file txmempool.h.
◆ mapSpentIndexInserted
|
private |
Definition at line 523 of file txmempool.h.
◆ setEntries
typedef std::set<txiter, CompareIteratorByHash> CTxMemPool::setEntries |
Definition at line 499 of file txmempool.h.
◆ txiter
typedef indexed_transaction_set::nth_index<0>::type::iterator CTxMemPool::txiter |
Definition at line 491 of file txmempool.h.
◆ txlinksMap
|
private |
Definition at line 511 of file txmempool.h.
Constructor & Destructor Documentation
◆ CTxMemPool()
|
explicit |
Create a new CTxMemPool.
Definition at line 333 of file txmempool.cpp.
References _clear(), and nCheckFrequency.
Member Function Documentation
◆ _clear()
void CTxMemPool::_clear | ( | ) |
Definition at line 983 of file txmempool.cpp.
References blockSinceLastRollingFeeBump, cachedInnerUsage, indirectmap< K, T >::clear(), GetTime(), lastRollingFeeUpdate, mapLinks, mapNextTx, mapProTxAddresses, mapProTxPubKeyIDs, mapTx, nTransactionsUpdated, rollingMinimumFeeRate, and totalTxSize.
Referenced by clear(), and CTxMemPool().
◆ addAddressIndex()
void CTxMemPool::addAddressIndex | ( | const CTxMemPoolEntry & | entry, |
const CCoinsViewCache & | view | ||
) |
Definition at line 468 of file txmempool.cpp.
References CCoinsViewCache::AccessCoin(), prevector< N, T, Size, Diff >::begin(), cs, prevector< N, T, Size, Diff >::end(), CTransaction::GetHash(), CTxMemPoolEntry::GetTime(), CTxMemPoolEntry::GetTx(), COutPoint::hash, Hash160(), CScript::IsPayToPublicKey(), CScript::IsPayToPublicKeyHash(), CScript::IsPayToScriptHash(), LOCK, mapAddress, mapAddressInserted, COutPoint::n, CTxOut::nValue, Coin::out, CTxIn::prevout, CTxOut::scriptPubKey, CTransaction::vin, and CTransaction::vout.
Referenced by AcceptToMemoryPoolWorker().
◆ addSpentIndex()
void CTxMemPool::addSpentIndex | ( | const CTxMemPoolEntry & | entry, |
const CCoinsViewCache & | view | ||
) |
Definition at line 555 of file txmempool.cpp.
References CCoinsViewCache::AccessCoin(), prevector< N, T, Size, Diff >::begin(), cs, prevector< N, T, Size, Diff >::end(), CTransaction::GetHash(), CTxMemPoolEntry::GetTx(), COutPoint::hash, Hash160(), CScript::IsPayToPublicKey(), CScript::IsPayToPublicKeyHash(), CScript::IsPayToScriptHash(), LOCK, mapSpent, mapSpentInserted, COutPoint::n, CTxOut::nValue, Coin::out, CTxIn::prevout, CTxOut::scriptPubKey, base_blob< BITS >::SetNull(), and CTransaction::vin.
Referenced by AcceptToMemoryPoolWorker().
◆ AddTransactionsUpdated()
void CTxMemPool::AddTransactionsUpdated | ( | unsigned int | n | ) |
Definition at line 356 of file txmempool.cpp.
References cs, LOCK, and nTransactionsUpdated.
Referenced by PrepareShutdown(), UpdateTip(), and llmq::CInstantSendManager::UpdateWalletTransaction().
◆ addUnchecked() [1/2]
bool CTxMemPool::addUnchecked | ( | const uint256 & | hash, |
const CTxMemPoolEntry & | entry, | ||
bool | validFeeEstimate = true |
||
) |
Definition at line 1424 of file txmempool.cpp.
References CalculateMemPoolAncestors(), cs, and LOCK.
Referenced by AcceptToMemoryPoolWorker(), and AddTx().
◆ addUnchecked() [2/2]
bool CTxMemPool::addUnchecked | ( | const uint256 & | hash, |
const CTxMemPoolEntry & | entry, | ||
setEntries & | setAncestors, | ||
bool | validFeeEstimate = true |
||
) |
Definition at line 362 of file txmempool.cpp.
References CProRegTx::addr, CProUpServTx::addr, cachedInnerUsage, CProRegTx::collateralOutpoint, cs, deterministicMNManager, CTxMemPoolEntry::DynamicMemoryUsage(), CBLSWrapper< ImplType, _SerSize, C >::GetHash(), CTransaction::GetHash(), CTxMemPoolEntry::GetSharedTx(), GetTxPayload(), CTxMemPoolEntry::GetTxSize(), COutPoint::hash, indirectmap< K, T >::insert(), base_blob< BITS >::IsNull(), CProRegTx::keyIDOwner, LOCK, mapDeltas, mapLinks, mapNextTx, mapProTxAddresses, mapProTxBlsPubKeyHashes, mapProTxCollaterals, mapProTxPubKeyIDs, mapProTxRefs, mapTx, minerPolicyEstimator, NotifyEntryAdded, nTransactionsUpdated, CTransaction::nType, CBlockPolicyEstimator::processTransaction(), CProUpServTx::proTxHash, CProUpRegTx::proTxHash, CProUpRevTx::proTxHash, CProRegTx::pubKeyOperator, CProUpRegTx::pubKeyOperator, SerializeHash(), totalTxSize, TRANSACTION_PROVIDER_REGISTER, TRANSACTION_PROVIDER_UPDATE_REGISTRAR, TRANSACTION_PROVIDER_UPDATE_REVOKE, TRANSACTION_PROVIDER_UPDATE_SERVICE, UpdateAncestorsOf(), UpdateEntryForAncestors(), UpdateParent(), CTransaction::vin, and vTxHashes.
◆ ApplyDelta()
Definition at line 1347 of file txmempool.cpp.
References cs, LOCK, and mapDeltas.
Referenced by AcceptToMemoryPoolWorker().
◆ CalculateDescendants()
void CTxMemPool::CalculateDescendants | ( | txiter | it, |
setEntries & | setDescendants | ||
) |
Populate setDescendants with all in-mempool descendants of hash.
Assumes that setDescendants includes all in-mempool descendants of anything already in it.
Definition at line 702 of file txmempool.cpp.
References GetMemPoolChildren().
Referenced by Expire(), getmempooldescendants(), PrioritiseTransaction(), removeForReorg(), removeRecursive(), TrimToSize(), UpdateForRemoveFromMempool(), and BlockAssembler::UpdatePackagesForAdded().
◆ CalculateMemPoolAncestors()
bool CTxMemPool::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 |
Try to calculate all in-mempool ancestors of entry.
(these are all calculated including the tx itself) limitAncestorCount = max number of ancestors limitAncestorSize = max size of ancestors limitDescendantCount = max number of descendants any ancestor can have limitDescendantSize = max size of descendants any ancestor can have errString = populated with error reason if any limits are hit fSearchForParents = whether to search a tx's vin for in-mempool parents, or look up parents from mapLinks. Must be true for entries not in the mempool
Definition at line 154 of file txmempool.cpp.
References cs, GetMemPoolParents(), CTxMemPoolEntry::GetTx(), CTxMemPoolEntry::GetTxSize(), LOCK, mapTx, strprintf, and CTransaction::vin.
Referenced by AcceptToMemoryPoolWorker(), BlockAssembler::addPackageTxs(), addUnchecked(), check(), CWallet::CreateTransaction(), getmempoolancestors(), PrioritiseTransaction(), and UpdateForRemoveFromMempool().
◆ check()
void CTxMemPool::check | ( | const CCoinsViewCache * | pcoins | ) | const |
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.
Definition at line 1013 of file txmempool.cpp.
References cachedInnerUsage, CalculateMemPoolAncestors(), indirectmap< K, T >::cbegin(), indirectmap< K, T >::cend(), CheckInputsAndUpdateCoins(), cs, memusage::DynamicUsage(), indirectmap< K, T >::end(), indirectmap< K, T >::find(), GetMemPoolChildren(), GetMemPoolParents(), GetRand(), GetSpendHeight(), CTxMemPoolEntry::GetTx(), COutPoint::hash, CCoinsViewCache::HaveCoin(), CCoinsViewCache::HaveInputs(), LOCK, LogPrint, indirectmap< K, T >::lower_bound(), mapLinks, mapNextTx, mapTx, BCLog::MEMPOOL, COutPoint::n, nCheckFrequency, CTxIn::prevout, indirectmap< K, T >::size(), totalTxSize, CTransaction::vin, and CTransaction::vout.
Referenced by CChainState::ActivateBestChainStep(), ProcessMessage(), and while().
◆ clear()
void CTxMemPool::clear | ( | ) |
Definition at line 998 of file txmempool.cpp.
References _clear(), cs, and LOCK.
Referenced by UnloadBlockIndex().
◆ ClearPrioritisation()
void CTxMemPool::ClearPrioritisation | ( | const uint256 | hash | ) |
Definition at line 1357 of file txmempool.cpp.
References cs, LOCK, and mapDeltas.
Referenced by removeConflicts(), and removeForBlock().
◆ CompareDepthAndScore()
Definition at line 1135 of file txmempool.cpp.
References cs, LOCK, and mapTx.
Referenced by CompareInvMempoolOrder::operator()().
◆ DynamicMemoryUsage()
size_t CTxMemPool::DynamicMemoryUsage | ( | ) | const |
Definition at line 1389 of file txmempool.cpp.
References cachedInnerUsage, cs, memusage::DynamicUsage(), LOCK, memusage::MallocUsage(), mapDeltas, mapLinks, mapNextTx, mapTx, and vTxHashes.
Referenced by FlushStateToDisk(), ClientModel::getMempoolDynamicUsage(), GetMinFee(), MempoolEviction(), mempoolInfoToJSON(), ProcessMessage(), and TrimToSize().
◆ exists()
|
inline |
Definition at line 672 of file txmempool.h.
References cs, LOCK, and mapTx.
Referenced by CWalletTx::AcceptToMemoryPool(), AcceptToMemoryPoolWorker(), AlreadyHave(), entryToJSON(), CMerkleTx::GetDepthInMainChain(), HasNoInputsOf(), LoadMempool(), sendrawtransaction(), TrimToSize(), and UpdateMempoolForReorg().
◆ existsProviderTxConflict()
bool CTxMemPool::existsProviderTxConflict | ( | const CTransaction & | tx | ) | const |
Definition at line 1229 of file txmempool.cpp.
References CProRegTx::addr, CProUpServTx::addr, CProRegTx::collateralOutpoint, indirectmap< K, T >::count(), cs, deterministicMNManager, CBLSWrapper< ImplType, _SerSize, C >::GetHash(), GetTxPayload(), COutPoint::hash, base_blob< BITS >::IsNull(), CProRegTx::keyIDOwner, LOCK, LogPrint, mapNextTx, mapProTxAddresses, mapProTxBlsPubKeyHashes, mapProTxCollaterals, mapProTxPubKeyIDs, mapProTxRefs, mapTx, BCLog::MEMPOOL, CTransaction::nType, CProUpServTx::proTxHash, CProUpRegTx::proTxHash, CProUpRevTx::proTxHash, CProRegTx::pubKeyOperator, CProUpRegTx::pubKeyOperator, base_blob< BITS >::ToString(), CTransaction::ToString(), TRANSACTION_PROVIDER_REGISTER, TRANSACTION_PROVIDER_UPDATE_REGISTRAR, TRANSACTION_PROVIDER_UPDATE_REVOKE, and TRANSACTION_PROVIDER_UPDATE_SERVICE.
Referenced by AcceptToMemoryPoolWorker().
◆ Expire()
int CTxMemPool::Expire | ( | int64_t | time | ) |
Expire all transaction (and their dependencies) in the mempool older than time.
Return the number of removed transactions.
Definition at line 1403 of file txmempool.cpp.
References CalculateDescendants(), cs, EXPIRY, LOCK, mapTx, llmq::quorumInstantSendManager, and RemoveStaged().
Referenced by LimitMempoolSize().
◆ get()
CTransactionRef CTxMemPool::get | ( | const uint256 & | hash | ) | const |
Definition at line 1211 of file txmempool.cpp.
References cs, LOCK, and mapTx.
Referenced by llmq::CInstantSendManager::CheckCanLock(), CheckInputsFromMempoolAndCache(), CCoinsViewMemPool::GetCoin(), GetTransaction(), CPrivateSend::IsCollateralValid(), and llmq::CInstantSendManager::RemoveMempoolConflictsForLock().
◆ getAddressIndex()
bool CTxMemPool::getAddressIndex | ( | std::vector< std::pair< uint160, int > > & | addresses, |
std::vector< std::pair< CMempoolAddressDeltaKey, CMempoolAddressDelta > > & | results | ||
) |
Definition at line 525 of file txmempool.cpp.
References cs, LOCK, and mapAddress.
Referenced by getaddressmempool().
◆ GetMemPoolChildren()
const CTxMemPool::setEntries & CTxMemPool::GetMemPoolChildren | ( | txiter | entry | ) | const |
Definition at line 1462 of file txmempool.cpp.
References mapLinks, and mapTx.
Referenced by CalculateDescendants(), check(), UpdateChildrenForRemoval(), and UpdateForDescendants().
◆ GetMemPoolParents()
const CTxMemPool::setEntries & CTxMemPool::GetMemPoolParents | ( | txiter | entry | ) | const |
Definition at line 1454 of file txmempool.cpp.
References mapLinks, and mapTx.
Referenced by CalculateMemPoolAncestors(), check(), and UpdateAncestorsOf().
◆ GetMinFee()
CFeeRate CTxMemPool::GetMinFee | ( | size_t | sizelimit | ) | const |
The minimum fee to get into the mempool, which may itself not be enough for larger-sized transactions.
The incrementalRelayFee 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 1470 of file txmempool.cpp.
References blockSinceLastRollingFeeBump, cs, DynamicMemoryUsage(), CFeeRate::GetFeePerK(), GetTime(), incrementalRelayFee, lastRollingFeeUpdate, LOCK, ROLLING_FEE_HALFLIFE, and rollingMinimumFeeRate.
Referenced by AcceptToMemoryPoolWorker(), GetMinimumFee(), and mempoolInfoToJSON().
◆ GetSortedDepthAndScore()
|
private |
Definition at line 1166 of file txmempool.cpp.
References AssertLockHeld(), cs, and mapTx.
Referenced by infoAll(), and queryHashes().
◆ getSpentIndex()
bool CTxMemPool::getSpentIndex | ( | CSpentIndexKey & | key, |
CSpentIndexValue & | value | ||
) |
Definition at line 595 of file txmempool.cpp.
References cs, LOCK, and mapSpent.
Referenced by GetSpentIndex().
◆ GetTotalTxSize()
|
inline |
Definition at line 666 of file txmempool.h.
References cs, LOCK, and totalTxSize.
Referenced by mempoolInfoToJSON().
◆ GetTransactionsUpdated()
unsigned int CTxMemPool::GetTransactionsUpdated | ( | ) | const |
Definition at line 350 of file txmempool.cpp.
References cs, LOCK, and nTransactionsUpdated.
Referenced by getblocktemplate().
◆ HasNoInputsOf()
bool CTxMemPool::HasNoInputsOf | ( | const CTransaction & | tx | ) | const |
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.
Definition at line 1363 of file txmempool.cpp.
References exists(), and CTransaction::vin.
Referenced by AcceptToMemoryPoolWorker().
◆ info()
TxMempoolInfo CTxMemPool::info | ( | const uint256 & | hash | ) | const |
Definition at line 1220 of file txmempool.cpp.
References cs, GetInfo(), LOCK, and mapTx.
Referenced by ProcessGetData(), and PeerLogicValidation::SendMessages().
◆ infoAll()
std::vector< TxMempoolInfo > CTxMemPool::infoAll | ( | ) | const |
Definition at line 1197 of file txmempool.cpp.
References cs, GetInfo(), GetSortedDepthAndScore(), LOCK, and mapTx.
Referenced by DumpMempool(), and PeerLogicValidation::SendMessages().
◆ isSpent()
bool CTxMemPool::isSpent | ( | const COutPoint & | outpoint | ) |
Definition at line 344 of file txmempool.cpp.
References indirectmap< K, T >::count(), cs, LOCK, and mapNextTx.
Referenced by gettxout(), CPrivateSend::IsCollateralValid(), and rest_getutxos().
◆ PrioritiseTransaction()
Affect CreateNewBlock prioritisation of transactions.
Definition at line 1317 of file txmempool.cpp.
References CalculateDescendants(), CalculateMemPoolAncestors(), cs, FormatMoney(), LOCK, LogPrintf, mapDeltas, mapTx, nTransactionsUpdated, and base_blob< BITS >::ToString().
Referenced by CPrivateSendServer::CommitFinalTransaction(), LoadMempool(), prioritisetransaction(), and ProcessMessage().
◆ queryHashes()
void CTxMemPool::queryHashes | ( | std::vector< uint256 > & | vtxid | ) |
Definition at line 1180 of file txmempool.cpp.
References cs, GetSortedDepthAndScore(), LOCK, and mapTx.
Referenced by CBlockPolicyEstimator::FlushUnconfirmed(), and mempoolToJSON().
◆ removeAddressIndex()
bool CTxMemPool::removeAddressIndex | ( | const uint256 | txhash | ) |
Definition at line 539 of file txmempool.cpp.
References cs, LOCK, mapAddress, and mapAddressInserted.
Referenced by removeUnchecked().
◆ removeConflicts()
void CTxMemPool::removeConflicts | ( | const CTransaction & | tx | ) |
Definition at line 794 of file txmempool.cpp.
References ClearPrioritisation(), CONFLICT, cs, indirectmap< K, T >::end(), indirectmap< K, T >::find(), CTransaction::GetHash(), LOCK, mapNextTx, CTxIn::prevout, removeRecursive(), and CTransaction::vin.
Referenced by removeForBlock().
◆ removeForBlock()
void CTxMemPool::removeForBlock | ( | const std::vector< CTransactionRef > & | vtx, |
unsigned int | nBlockHeight | ||
) |
Called when a block is connected.
Removes from mempool and updates the miner fee estimator.
Definition at line 953 of file txmempool.cpp.
References BLOCK, blockSinceLastRollingFeeBump, ClearPrioritisation(), cs, GetTime(), lastRollingFeeUpdate, LOCK, mapTx, minerPolicyEstimator, CBlockPolicyEstimator::processBlock(), removeConflicts(), removeProTxConflicts(), and RemoveStaged().
Referenced by CChainState::ConnectTip().
◆ removeForReorg()
void CTxMemPool::removeForReorg | ( | const CCoinsViewCache * | pcoins, |
unsigned int | nMemPoolHeight, | ||
int | flags | ||
) |
Definition at line 757 of file txmempool.cpp.
References CCoinsViewCache::AccessCoin(), CalculateDescendants(), CheckFinalTx(), CheckSequenceLocks(), COINBASE_MATURITY, cs, flags, COutPoint::hash, Coin::IsCoinBase(), Coin::IsSpent(), LOCK, mapTx, nCheckFrequency, Coin::nHeight, CTxIn::prevout, RemoveStaged(), REORG, TestLockPointValidity(), and CTransaction::vin.
Referenced by UpdateMempoolForReorg().
◆ removeProTxCollateralConflicts()
void CTxMemPool::removeProTxCollateralConflicts | ( | const CTransaction & | tx, |
const COutPoint & | collateralOutpoint | ||
) |
Definition at line 831 of file txmempool.cpp.
References CONFLICT, CTransaction::GetHash(), mapProTxCollaterals, mapTx, and removeRecursive().
Referenced by removeProTxConflicts().
◆ removeProTxConflicts()
void CTxMemPool::removeProTxConflicts | ( | const CTransaction & | tx | ) |
Definition at line 895 of file txmempool.cpp.
References CProRegTx::addr, CProUpServTx::addr, CProRegTx::collateralOutpoint, CONFLICT, CTransaction::GetHash(), GetTxPayload(), COutPoint::hash, base_blob< BITS >::IsNull(), CProRegTx::keyIDOwner, LogPrint, mapProTxAddresses, mapTx, BCLog::MEMPOOL, CTransaction::nType, CProUpRegTx::proTxHash, CProUpRevTx::proTxHash, CProRegTx::pubKeyOperator, CProUpRegTx::pubKeyOperator, removeProTxCollateralConflicts(), removeProTxKeyChangedConflicts(), removeProTxPubKeyConflicts(), removeProTxSpentCollateralConflicts(), removeRecursive(), SerializeHash(), CTransaction::ToString(), TRANSACTION_PROVIDER_REGISTER, TRANSACTION_PROVIDER_UPDATE_REGISTRAR, TRANSACTION_PROVIDER_UPDATE_REVOKE, and TRANSACTION_PROVIDER_UPDATE_SERVICE.
Referenced by removeForBlock().
◆ removeProTxKeyChangedConflicts()
void CTxMemPool::removeProTxKeyChangedConflicts | ( | const CTransaction & | tx, |
const uint256 & | proTxHash, | ||
const uint256 & | newKeyHash | ||
) |
Definition at line 877 of file txmempool.cpp.
References CONFLICT, mapProTxRefs, mapTx, and removeRecursive().
Referenced by removeProTxConflicts().
◆ removeProTxPubKeyConflicts() [1/2]
void CTxMemPool::removeProTxPubKeyConflicts | ( | const CTransaction & | tx, |
const CKeyID & | keyId | ||
) |
Definition at line 811 of file txmempool.cpp.
References CONFLICT, CTransaction::GetHash(), mapProTxPubKeyIDs, mapTx, and removeRecursive().
Referenced by removeProTxConflicts().
◆ removeProTxPubKeyConflicts() [2/2]
void CTxMemPool::removeProTxPubKeyConflicts | ( | const CTransaction & | tx, |
const CBLSPublicKey & | pubKey | ||
) |
Definition at line 821 of file txmempool.cpp.
References CONFLICT, CBLSWrapper< ImplType, _SerSize, C >::GetHash(), CTransaction::GetHash(), mapProTxBlsPubKeyHashes, mapTx, and removeRecursive().
◆ removeProTxSpentCollateralConflicts()
void CTxMemPool::removeProTxSpentCollateralConflicts | ( | const CTransaction & | tx | ) |
Definition at line 841 of file txmempool.cpp.
References CONFLICT, deterministicMNManager, LogPrint, mapProTxCollaterals, mapProTxRefs, mapTx, BCLog::MEMPOOL, removeRecursive(), and CTransaction::vin.
Referenced by removeProTxConflicts().
◆ removeRecursive()
void CTxMemPool::removeRecursive | ( | const CTransaction & | tx, |
MemPoolRemovalReason | reason = MemPoolRemovalReason::UNKNOWN |
||
) |
Definition at line 725 of file txmempool.cpp.
References CalculateDescendants(), cs, indirectmap< K, T >::end(), indirectmap< K, T >::find(), CTransaction::GetHash(), LOCK, mapNextTx, mapTx, RemoveStaged(), and CTransaction::vout.
Referenced by CChainState::DisconnectTip(), removeConflicts(), llmq::CInstantSendManager::RemoveMempoolConflictsForLock(), removeProTxCollateralConflicts(), removeProTxConflicts(), removeProTxKeyChangedConflicts(), removeProTxPubKeyConflicts(), removeProTxSpentCollateralConflicts(), and UpdateMempoolForReorg().
◆ removeSpentIndex()
bool CTxMemPool::removeSpentIndex | ( | const uint256 | txhash | ) |
Definition at line 608 of file txmempool.cpp.
References cs, LOCK, mapSpent, and mapSpentInserted.
Referenced by removeUnchecked().
◆ RemoveStaged()
void CTxMemPool::RemoveStaged | ( | setEntries & | stage, |
bool | updateDescendants, | ||
MemPoolRemovalReason | reason = MemPoolRemovalReason::UNKNOWN |
||
) |
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 transaction is being removed for being in a block. Set updateDescendants to true when removing a tx that was in a block, so that any in-mempool descendants have their ancestor state updated.
Definition at line 1395 of file txmempool.cpp.
References AssertLockHeld(), cs, removeUnchecked(), and UpdateForRemoveFromMempool().
Referenced by Expire(), removeForBlock(), removeForReorg(), removeRecursive(), and TrimToSize().
◆ removeUnchecked()
|
private |
Before calling removeUnchecked for a given transaction, UpdateForRemoveFromMempool must be called on the entire (dependent) set of transactions being removed at the same time.
We use each CTxMemPoolEntry's setMemPoolParents in order to walk ancestors of a given transaction that is removed, so we can't remove intermediate transactions in a chain before we've updated all the state for the removal.
Definition at line 624 of file txmempool.cpp.
References CProRegTx::addr, CProUpServTx::addr, cachedInnerUsage, CProRegTx::collateralOutpoint, memusage::DynamicUsage(), indirectmap< K, T >::erase(), CBLSWrapper< ImplType, _SerSize, C >::GetHash(), GetTxPayload(), COutPoint::hash, COutPoint::IsNull(), CProRegTx::keyIDOwner, mapLinks, mapNextTx, mapProTxAddresses, mapProTxBlsPubKeyHashes, mapProTxCollaterals, mapProTxPubKeyIDs, mapProTxRefs, mapTx, minerPolicyEstimator, NotifyEntryRemoved, nTransactionsUpdated, CProUpServTx::proTxHash, CProUpRegTx::proTxHash, CProUpRevTx::proTxHash, CProRegTx::pubKeyOperator, CProUpRegTx::pubKeyOperator, removeAddressIndex(), removeSpentIndex(), CBlockPolicyEstimator::removeTx(), totalTxSize, TRANSACTION_PROVIDER_REGISTER, TRANSACTION_PROVIDER_UPDATE_REGISTRAR, TRANSACTION_PROVIDER_UPDATE_REVOKE, TRANSACTION_PROVIDER_UPDATE_SERVICE, and vTxHashes.
Referenced by RemoveStaged().
◆ setSanityCheck()
|
inline |
Definition at line 552 of file txmempool.h.
References nCheckFrequency.
Referenced by AppInitParameterInteraction().
◆ size()
|
inline |
Definition at line 660 of file txmempool.h.
References cs, LOCK, and mapTx.
Referenced by ClientModel::getMempoolSize(), getmininginfo(), mempoolInfoToJSON(), and ProcessMessage().
◆ trackPackageRemoved()
|
private |
Definition at line 1494 of file txmempool.cpp.
References AssertLockHeld(), blockSinceLastRollingFeeBump, cs, CFeeRate::GetFeePerK(), and rollingMinimumFeeRate.
Referenced by TrimToSize().
◆ TransactionWithinChainLimit()
bool CTxMemPool::TransactionWithinChainLimit | ( | const uint256 & | txid, |
size_t | chainLimit | ||
) | const |
Returns false if the transaction is in the mempool and not within the chain limit specified.
Definition at line 1545 of file txmempool.cpp.
References cs, LOCK, and mapTx.
Referenced by CWallet::SelectCoinsMinConf().
◆ TrimToSize()
void CTxMemPool::TrimToSize | ( | size_t | sizelimit, |
std::vector< COutPoint > * | pvNoSpendsRemaining = nullptr |
||
) |
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.
Definition at line 1502 of file txmempool.cpp.
References CalculateDescendants(), cs, DynamicMemoryUsage(), exists(), COutPoint::hash, incrementalRelayFee, LOCK, LogPrint, mapTx, BCLog::MEMPOOL, CTxIn::prevout, RemoveStaged(), SIZELIMIT, CFeeRate::ToString(), and trackPackageRemoved().
Referenced by LimitMempoolSize(), and MempoolEviction().
◆ UpdateAncestorsOf()
|
private |
Update ancestors of hash to add/remove it as a descendant transaction.
Definition at line 218 of file txmempool.cpp.
References GetMemPoolParents(), mapTx, and UpdateChild().
Referenced by addUnchecked(), and UpdateForRemoveFromMempool().
◆ UpdateChild()
Definition at line 1434 of file txmempool.cpp.
References cachedInnerUsage, memusage::IncrementalDynamicUsage(), and mapLinks.
Referenced by UpdateAncestorsOf(), and UpdateTransactionsFromBlock().
◆ UpdateChildrenForRemoval()
|
private |
Sever link between specified transaction and direct children.
Definition at line 247 of file txmempool.cpp.
References GetMemPoolChildren(), and UpdateParent().
Referenced by UpdateForRemoveFromMempool().
◆ UpdateEntryForAncestors()
|
private |
Set ancestor state for an entry.
Definition at line 233 of file txmempool.cpp.
References mapTx.
Referenced by addUnchecked().
◆ UpdateForDescendants()
|
private |
UpdateForDescendants is used by UpdateTransactionsFromBlock to update the 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.
setExclude is the set of descendant transactions in the mempool that must not be accounted for (because any descendants in setExclude were added to the mempool after the transaction being updated and hence their state is already reflected in the parent state).
cachedDescendants will be updated with the descendants of the transaction being updated, so that future invocations don't need to walk the same transaction again, if encountered in another transaction chain.
Definition at line 64 of file txmempool.cpp.
References GetMemPoolChildren(), and mapTx.
Referenced by UpdateTransactionsFromBlock().
◆ UpdateForRemoveFromMempool()
|
private |
For each transaction being removed, update ancestors and any direct children.
If updateDescendants is true, then also update in-mempool descendants' ancestor state.
Definition at line 255 of file txmempool.cpp.
References CalculateDescendants(), CalculateMemPoolAncestors(), mapTx, UpdateAncestorsOf(), and UpdateChildrenForRemoval().
Referenced by RemoveStaged().
◆ UpdateParent()
Definition at line 1444 of file txmempool.cpp.
References cachedInnerUsage, memusage::IncrementalDynamicUsage(), and mapLinks.
Referenced by addUnchecked(), UpdateChildrenForRemoval(), and UpdateTransactionsFromBlock().
◆ UpdateTransactionsFromBlock()
void CTxMemPool::UpdateTransactionsFromBlock | ( | const std::vector< uint256 > & | vHashesToUpdate | ) |
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).
UpdateTransactionsFromBlock() will find child transactions and update the descendant state for each transaction in vHashesToUpdate (excluding any child transactions present in vHashesToUpdate, which are already accounted for). Note: vHashesToUpdate should be the set of transactions from the disconnected block that have been accepted back into the mempool.
Definition at line 111 of file txmempool.cpp.
References cs, indirectmap< K, T >::end(), LOCK, indirectmap< K, T >::lower_bound(), mapNextTx, mapTx, reverse_iterate(), UpdateChild(), UpdateForDescendants(), and UpdateParent().
Referenced by UpdateMempoolForReorg().
Member Data Documentation
◆ blockSinceLastRollingFeeBump
|
mutableprivate |
Definition at line 453 of file txmempool.h.
Referenced by _clear(), GetMinFee(), removeForBlock(), and trackPackageRemoved().
◆ cachedInnerUsage
|
private |
sum of dynamic memory usage of all the map elements (NOT the maps themselves)
Definition at line 450 of file txmempool.h.
Referenced by _clear(), addUnchecked(), check(), DynamicMemoryUsage(), removeUnchecked(), UpdateChild(), and UpdateParent().
◆ cs
|
mutable |
Definition at line 488 of file txmempool.h.
Referenced by AcceptToMemoryPoolWorker(), addAddressIndex(), addSpentIndex(), AddTransactionsUpdated(), addUnchecked(), ApplyDelta(), CalculateMemPoolAncestors(), check(), CheckInputsFromMempoolAndCache(), CheckSequenceLocks(), llmq::CChainLocksHandler::Cleanup(), clear(), ClearPrioritisation(), combinerawtransaction(), CWallet::CommitTransaction(), CompareDepthAndScore(), CPrivateSendClientSession::CreateDenominated(), BlockAssembler::CreateNewBlock(), CWallet::CreateTransaction(), CPrivateSendClientSession::DoAutomaticDenominating(), DumpMempool(), DynamicMemoryUsage(), entryToJSON(), exists(), existsProviderTxConflict(), Expire(), CWallet::FundTransaction(), get(), getAddressIndex(), getmempoolancestors(), getmempooldescendants(), getmempoolentry(), GetMinFee(), GetSortedDepthAndScore(), getSpentIndex(), GetTotalTxSize(), GetTransactionsUpdated(), gettxout(), info(), infoAll(), PartiallyDownloadedBlock::InitData(), isSpent(), CPrivateSendClientSession::MakeCollateralAmounts(), mempoolToJSON(), WalletModel::prepareTransaction(), PrioritiseTransaction(), queryHashes(), CWallet::ReacceptWalletTransactions(), removeAddressIndex(), removeConflicts(), removeForBlock(), removeForReorg(), llmq::CInstantSendManager::RemoveMempoolConflictsForLock(), removeRecursive(), removeSpentIndex(), RemoveStaged(), resendwallettransactions(), CWallet::ResendWalletTransactionsBefore(), rest_getutxos(), WalletModel::sendCoins(), sendfrom(), sendmany(), PeerLogicValidation::SendMessages(), sendtoaddress(), signrawtransaction(), size(), CPrivateSendClientSession::SubmitDenominate(), trackPackageRemoved(), TransactionWithinChainLimit(), TrimToSize(), and UpdateTransactionsFromBlock().
◆ lastRollingFeeUpdate
|
mutableprivate |
Definition at line 452 of file txmempool.h.
Referenced by _clear(), GetMinFee(), and removeForBlock().
◆ mapAddress
|
private |
Definition at line 515 of file txmempool.h.
Referenced by addAddressIndex(), getAddressIndex(), and removeAddressIndex().
◆ mapAddressInserted
|
private |
Definition at line 518 of file txmempool.h.
Referenced by addAddressIndex(), and removeAddressIndex().
◆ mapDeltas
Definition at line 539 of file txmempool.h.
Referenced by addUnchecked(), ApplyDelta(), ClearPrioritisation(), DumpMempool(), DynamicMemoryUsage(), and PrioritiseTransaction().
◆ mapLinks
|
private |
Definition at line 512 of file txmempool.h.
Referenced by _clear(), addUnchecked(), check(), DynamicMemoryUsage(), GetMemPoolChildren(), GetMemPoolParents(), removeUnchecked(), UpdateChild(), and UpdateParent().
◆ mapNextTx
indirectmap<COutPoint, const CTransaction*> CTxMemPool::mapNextTx |
Definition at line 538 of file txmempool.h.
Referenced by _clear(), AcceptToMemoryPoolWorker(), addUnchecked(), check(), DynamicMemoryUsage(), existsProviderTxConflict(), isSpent(), removeConflicts(), llmq::CInstantSendManager::RemoveMempoolConflictsForLock(), removeRecursive(), removeUnchecked(), and UpdateTransactionsFromBlock().
◆ mapProTxAddresses
Definition at line 527 of file txmempool.h.
Referenced by _clear(), addUnchecked(), existsProviderTxConflict(), removeProTxConflicts(), and removeUnchecked().
◆ mapProTxBlsPubKeyHashes
Definition at line 529 of file txmempool.h.
Referenced by addUnchecked(), existsProviderTxConflict(), removeProTxPubKeyConflicts(), and removeUnchecked().
◆ mapProTxCollaterals
Definition at line 530 of file txmempool.h.
Referenced by addUnchecked(), existsProviderTxConflict(), removeProTxCollateralConflicts(), removeProTxSpentCollateralConflicts(), and removeUnchecked().
◆ mapProTxPubKeyIDs
Definition at line 528 of file txmempool.h.
Referenced by _clear(), addUnchecked(), existsProviderTxConflict(), removeProTxPubKeyConflicts(), and removeUnchecked().
◆ mapProTxRefs
Definition at line 526 of file txmempool.h.
Referenced by addUnchecked(), existsProviderTxConflict(), removeProTxKeyChangedConflicts(), removeProTxSpentCollateralConflicts(), and removeUnchecked().
◆ mapSpent
|
private |
Definition at line 521 of file txmempool.h.
Referenced by addSpentIndex(), getSpentIndex(), and removeSpentIndex().
◆ mapSpentInserted
|
private |
Definition at line 524 of file txmempool.h.
Referenced by addSpentIndex(), and removeSpentIndex().
◆ mapTx
indexed_transaction_set CTxMemPool::mapTx |
Definition at line 489 of file txmempool.h.
Referenced by _clear(), BlockAssembler::addPackageTxs(), addUnchecked(), CalculateMemPoolAncestors(), check(), CompareDepthAndScore(), DynamicMemoryUsage(), exists(), existsProviderTxConflict(), Expire(), get(), getmempoolancestors(), GetMemPoolChildren(), getmempooldescendants(), getmempoolentry(), GetMemPoolParents(), GetSortedDepthAndScore(), info(), infoAll(), mempoolToJSON(), PrioritiseTransaction(), queryHashes(), removeForBlock(), removeForReorg(), removeProTxCollateralConflicts(), removeProTxConflicts(), removeProTxKeyChangedConflicts(), removeProTxPubKeyConflicts(), removeProTxSpentCollateralConflicts(), removeRecursive(), removeUnchecked(), size(), BlockAssembler::SkipMapTxEntry(), TransactionWithinChainLimit(), TrimToSize(), UpdateAncestorsOf(), UpdateEntryForAncestors(), UpdateForDescendants(), UpdateForRemoveFromMempool(), and UpdateTransactionsFromBlock().
◆ minerPolicyEstimator
|
private |
Definition at line 447 of file txmempool.h.
Referenced by addUnchecked(), removeForBlock(), and removeUnchecked().
◆ nCheckFrequency
|
private |
Value n means that n times in 2^32 we check.
Definition at line 445 of file txmempool.h.
Referenced by check(), CTxMemPool(), removeForReorg(), and setSanityCheck().
◆ NotifyEntryAdded
boost::signals2::signal<void (CTransactionRef)> CTxMemPool::NotifyEntryAdded |
Definition at line 686 of file txmempool.h.
Referenced by addUnchecked().
◆ NotifyEntryRemoved
boost::signals2::signal<void (CTransactionRef, MemPoolRemovalReason)> CTxMemPool::NotifyEntryRemoved |
Definition at line 687 of file txmempool.h.
Referenced by ConnectTrace::ConnectTrace(), CMainSignals::RegisterWithMempoolSignals(), removeUnchecked(), CMainSignals::UnregisterWithMempoolSignals(), and ConnectTrace::~ConnectTrace().
◆ nTransactionsUpdated
|
private |
Used by getblocktemplate to trigger CreateNewBlock() invocation.
Definition at line 446 of file txmempool.h.
Referenced by _clear(), AddTransactionsUpdated(), addUnchecked(), GetTransactionsUpdated(), PrioritiseTransaction(), and removeUnchecked().
◆ ROLLING_FEE_HALFLIFE
|
static |
Definition at line 460 of file txmempool.h.
Referenced by GetMinFee().
◆ rollingMinimumFeeRate
|
mutableprivate |
minimum fee to get into the pool, decreases exponentially
Definition at line 454 of file txmempool.h.
Referenced by _clear(), GetMinFee(), and trackPackageRemoved().
◆ totalTxSize
|
private |
sum of all mempool tx' byte sizes
Definition at line 449 of file txmempool.h.
Referenced by _clear(), addUnchecked(), check(), GetTotalTxSize(), and removeUnchecked().
◆ vTxHashes
All tx hashes/entries in mapTx, in random order.
Definition at line 492 of file txmempool.h.
Referenced by addUnchecked(), DynamicMemoryUsage(), PartiallyDownloadedBlock::InitData(), and removeUnchecked().
The documentation for this class was generated from the following files:
- src/txmempool.h
- src/txmempool.cpp