diff options
author | ismaelsadeeq <ask4ismailsadiq@gmail.com> | 2023-11-03 13:23:30 +0100 |
---|---|---|
committer | ismaelsadeeq <ask4ismailsadiq@gmail.com> | 2023-11-22 11:48:21 +0100 |
commit | 91532bd38223d7d04166e05de11d0d0b55e60f13 (patch) | |
tree | 8446e39a5ab8d24f00bef53762302dc675b85f44 /src/txmempool.cpp | |
parent | bfcd401368fc0dc43827a8969a37b7e038d5ca79 (diff) |
tx fees, policy: update `CBlockPolicyEstimator::processBlock` parameter
Update `processBlock` parameter to reference to a vector of `RemovedMempoolTransactionInfo`.
Diffstat (limited to 'src/txmempool.cpp')
-rw-r--r-- | src/txmempool.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp index f75dd7efea..f5036a9301 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -643,17 +643,6 @@ void CTxMemPool::removeConflicts(const CTransaction &tx) void CTxMemPool::removeForBlock(const std::vector<CTransactionRef>& vtx, unsigned int nBlockHeight) { AssertLockHeld(cs); - std::vector<const CTxMemPoolEntry*> entries; - for (const auto& tx : vtx) - { - uint256 hash = tx->GetHash(); - - indexed_transaction_set::iterator i = mapTx.find(hash); - if (i != mapTx.end()) - entries.push_back(&*i); - } - // Before the txs in the new block have been removed from the mempool, update policy estimates - if (minerPolicyEstimator) {minerPolicyEstimator->processBlock(nBlockHeight, entries);} std::vector<RemovedMempoolTransactionInfo> txs_removed_for_block; txs_removed_for_block.reserve(vtx.size()); for (const auto& tx : vtx) @@ -668,6 +657,10 @@ void CTxMemPool::removeForBlock(const std::vector<CTransactionRef>& vtx, unsigne removeConflicts(*tx); ClearPrioritisation(tx->GetHash()); } + // Update policy estimates + if (minerPolicyEstimator) { + minerPolicyEstimator->processBlock(txs_removed_for_block, nBlockHeight); + } GetMainSignals().MempoolTransactionsRemovedForBlock(txs_removed_for_block, nBlockHeight); lastRollingFeeUpdate = GetTime(); blockSinceLastRollingFeeBump = true; |