| 403 | } |
| 404 | |
| 405 | void CTxMemPool::removeForBlock(const std::vector<CTransactionRef>& vtx, unsigned int nBlockHeight) |
| 406 | { |
| 407 | // Remove confirmed txs and conflicts when a new block is connected, updating the fee logic |
| 408 | AssertLockHeld(cs); |
| 409 | Assume(!m_have_changeset); |
| 410 | std::vector<RemovedMempoolTransactionInfo> txs_removed_for_block; |
| 411 | if (mapTx.size() || mapNextTx.size() || mapDeltas.size()) { |
| 412 | txs_removed_for_block.reserve(vtx.size()); |
| 413 | for (const auto& tx : vtx) { |
| 414 | txiter it = mapTx.find(tx->GetHash()); |
| 415 | if (it != mapTx.end()) { |
| 416 | txs_removed_for_block.emplace_back(*it); |
| 417 | removeUnchecked(it, MemPoolRemovalReason::BLOCK); |
| 418 | } |
| 419 | removeConflicts(*tx); |
| 420 | ClearPrioritisation(tx->GetHash()); |
| 421 | } |
| 422 | } |
| 423 | if (m_opts.signals) { |
| 424 | m_opts.signals->MempoolTransactionsRemovedForBlock(txs_removed_for_block, nBlockHeight); |
| 425 | } |
| 426 | lastRollingFeeUpdate = GetTime(); |
| 427 | blockSinceLastRollingFeeBump = true; |
| 428 | if (!m_txgraph->DoWork(/*max_cost=*/POST_CHANGE_COST)) { |
| 429 | LogDebug(BCLog::MEMPOOL, "Mempool in non-optimal ordering after block."); |
| 430 | } |
| 431 | } |
| 432 | |
| 433 | void CTxMemPool::check(const CCoinsViewCache& active_coins_tip, int64_t spendheight) const |
| 434 | { |
no test coverage detected