Remove the transaction in the specified position from the graph. */
| 188 | |
| 189 | /** Remove the transaction in the specified position from the graph. */ |
| 190 | void RemoveTransaction(TxGraph::Ref* ref) |
| 191 | { |
| 192 | auto pos = Find(ref); |
| 193 | if (pos == MISSING) return; |
| 194 | MakeModified(pos); |
| 195 | real_is_optimal = false; |
| 196 | graph.RemoveTransactions(SetType::Singleton(pos)); |
| 197 | simrevmap.erase(simmap[pos].get()); |
| 198 | // Retain the TxGraph::Ref corresponding to this position, so the Ref destruction isn't |
| 199 | // invoked until the simulation explicitly decided to do so. |
| 200 | removed.push_back(std::move(simmap[pos])); |
| 201 | simmap[pos].reset(); |
| 202 | // This may invalidate our cached oversized value. |
| 203 | if (oversized.has_value() && *oversized) oversized = std::nullopt; |
| 204 | } |
| 205 | |
| 206 | /** Destroy the transaction from the graph, including from the removed set. This will |
| 207 | * trigger TxGraph::Ref::~Ref. reset_oversize controls whether the cached oversized |