| 555 | } |
| 556 | |
| 557 | void CTxMemPool::removeUnchecked(txiter it, MemPoolRemovalReason reason) |
| 558 | { |
| 559 | // We increment mempool sequence value no matter removal reason |
| 560 | // even if not directly reported below. |
| 561 | uint64_t mempool_sequence = GetAndIncrementSequence(); |
| 562 | |
| 563 | if (reason != MemPoolRemovalReason::BLOCK) { |
| 564 | // Notify clients that a transaction has been removed from the mempool |
| 565 | // for any reason except being included in a block. Clients interested |
| 566 | // in transactions included in blocks can subscribe to the BlockConnected |
| 567 | // notification. |
| 568 | GetMainSignals().TransactionRemovedFromMempool(it->GetSharedTx(), reason, mempool_sequence); |
| 569 | } |
| 570 | |
| 571 | const uint256 hash = it->GetTx().GetHash(); |
| 572 | for (const CTxIn& txin : it->GetTx().vin) |
| 573 | mapNextTx.erase(txin.prevout); |
| 574 | |
| 575 | RemoveUnbroadcastTx(hash, true /* add logging because unchecked */ ); |
| 576 | |
| 577 | if (vTxHashes.size() > 1) { |
| 578 | vTxHashes[it->vTxHashesIdx] = std::move(vTxHashes.back()); |
| 579 | vTxHashes[it->vTxHashesIdx].second->vTxHashesIdx = it->vTxHashesIdx; |
| 580 | vTxHashes.pop_back(); |
| 581 | if (vTxHashes.size() * 2 < vTxHashes.capacity()) |
| 582 | vTxHashes.shrink_to_fit(); |
| 583 | } else |
| 584 | vTxHashes.clear(); |
| 585 | |
| 586 | totalTxSize -= it->GetTxSize(); |
| 587 | m_total_fee -= it->GetFee(); |
| 588 | cachedInnerUsage -= it->DynamicMemoryUsage(); |
| 589 | cachedInnerUsage -= memusage::DynamicUsage(it->GetMemPoolParentsConst()) + memusage::DynamicUsage(it->GetMemPoolChildrenConst()); |
| 590 | mapTx.erase(it); |
| 591 | nTransactionsUpdated++; |
| 592 | if (minerPolicyEstimator) {minerPolicyEstimator->removeTx(hash, false);} |
| 593 | } |
| 594 | |
| 595 | // Calculates descendants of entry that are not already in setDescendants, and adds to |
| 596 | // setDescendants. Assumes entryit is already a tx in the mempool and CTxMemPoolEntry::m_children |
nothing calls this directly
no test coverage detected