MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / RemoveTransaction

Method RemoveTransaction

src/test/fuzz/txgraph.cpp:190–204  ·  view source on GitHub ↗

Remove the transaction in the specified position from the graph. */

Source from the content-addressed store, hash-verified

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

Callers 2

BOOST_AUTO_TEST_CASEFunction · 0.45
FUZZ_TARGETFunction · 0.45

Calls 7

FindFunction · 0.85
RemoveTransactionsMethod · 0.80
eraseMethod · 0.45
getMethod · 0.45
push_backMethod · 0.45
resetMethod · 0.45
has_valueMethod · 0.45

Tested by

no test coverage detected