| 59 | } |
| 60 | |
| 61 | void DisconnectedBlockTransactions::removeForBlock(const std::vector<CTransactionRef>& vtx) |
| 62 | { |
| 63 | // Short-circuit in the common case of a block being added to the tip |
| 64 | if (queuedTx.empty()) { |
| 65 | return; |
| 66 | } |
| 67 | for (const auto& tx : vtx) { |
| 68 | auto iter = iters_by_txid.find(tx->GetHash()); |
| 69 | if (iter != iters_by_txid.end()) { |
| 70 | auto list_iter = iter->second; |
| 71 | iters_by_txid.erase(iter); |
| 72 | cachedInnerUsage -= RecursiveDynamicUsage(*list_iter); |
| 73 | queuedTx.erase(list_iter); |
| 74 | } |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | void DisconnectedBlockTransactions::clear() |
| 79 | { |