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

Method AddTransaction

src/test/fuzz/txgraph.cpp:150–163  ·  view source on GitHub ↗

Add a new transaction to the simulation and the specified real graph. */

Source from the content-addressed store, hash-verified

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)

Callers 8

BOOST_AUTO_TEST_CASEFunction · 0.45
FUZZ_TARGETFunction · 0.45
BuildTreeGraphFunction · 0.45
FUZZ_TARGETFunction · 0.45
UnserMethod · 0.45
BenchTxGraphTrimFunction · 0.45
MakeWideGraphFunction · 0.45

Calls 3

TxCountMethod · 0.80
getMethod · 0.45
has_valueMethod · 0.45

Tested by

no test coverage detected