Add a new transaction to the simulation and the specified real graph. */
| 148 | |
| 149 | /** Add a new transaction to the simulation and the specified real graph. */ |
| 150 | void AddTransaction(TxGraph& txgraph, const FeePerWeight& feerate, uint64_t txid) |
| 151 | { |
| 152 | assert(graph.TxCount() < MAX_TRANSACTIONS); |
| 153 | auto simpos = graph.AddTransaction(feerate); |
| 154 | real_is_optimal = false; |
| 155 | MakeModified(simpos); |
| 156 | assert(graph.Positions()[simpos]); |
| 157 | simmap[simpos] = std::make_shared<SimTxObject>(txid); |
| 158 | txgraph.AddTransaction(*simmap[simpos], feerate); |
| 159 | auto ptr = simmap[simpos].get(); |
| 160 | simrevmap[ptr] = simpos; |
| 161 | // This may invalidate our cached oversized value. |
| 162 | if (oversized.has_value() && !*oversized) oversized = std::nullopt; |
| 163 | } |
| 164 | |
| 165 | /** Add a dependency between two positions in this graph. */ |
| 166 | void AddDependency(TxGraph::Ref* parent, TxGraph::Ref* child) |
no test coverage detected