| 412 | } |
| 413 | |
| 414 | void CTxMemPool::removeUnchecked(txiter it, MemPoolRemovalReason reason) |
| 415 | { |
| 416 | NotifyEntryRemoved(it->GetSharedTx(), reason); |
| 417 | const uint256 hash = it->GetTx().GetHash(); |
| 418 | for (const CTxIn& txin : it->GetTx().vin) |
| 419 | mapNextTx.erase(txin.prevout); |
| 420 | |
| 421 | if (vTxHashes.size() > 1) { |
| 422 | vTxHashes[it->vTxHashesIdx] = std::move(vTxHashes.back()); |
| 423 | vTxHashes[it->vTxHashesIdx].second->vTxHashesIdx = it->vTxHashesIdx; |
| 424 | vTxHashes.pop_back(); |
| 425 | if (vTxHashes.size() * 2 < vTxHashes.capacity()) |
| 426 | vTxHashes.shrink_to_fit(); |
| 427 | } else |
| 428 | vTxHashes.clear(); |
| 429 | |
| 430 | totalTxSize -= it->GetTxSize(); |
| 431 | cachedInnerUsage -= it->DynamicMemoryUsage(); |
| 432 | cachedInnerUsage -= memusage::DynamicUsage(mapLinks[it].parents) + memusage::DynamicUsage(mapLinks[it].children); |
| 433 | mapLinks.erase(it); |
| 434 | mapTx.erase(it); |
| 435 | nTransactionsUpdated++; |
| 436 | if (minerPolicyEstimator) {minerPolicyEstimator->removeTx(hash, false);} |
| 437 | } |
| 438 | |
| 439 | // Calculates descendants of entry that are not already in setDescendants, and adds to |
| 440 | // setDescendants. Assumes entryit is already a tx in the mempool and setMemPoolChildren |
nothing calls this directly
no test coverage detected