@@ -224,18 +224,15 @@ FUZZ_TARGET(ephemeral_package_eval, .init = initialize_tx_pool)
224
224
225
225
std::set<COutPoint> package_outpoints;
226
226
while (txs.size () < num_txs) {
227
-
228
- // Last transaction in a package needs to be a child of parents to get further in validation
229
- // so the last transaction to be generated(in a >1 package) must spend all package-made outputs
230
- // Note that this test currently only spends package outputs in last transaction.
231
- bool last_tx = num_txs > 1 && txs.size () == num_txs - 1 ;
232
-
233
227
// Create transaction to add to the mempool
234
228
txs.emplace_back ([&] {
235
229
CMutableTransaction tx_mut;
236
230
tx_mut.version = CTransaction::CURRENT_VERSION;
237
231
tx_mut.nLockTime = 0 ;
238
- // Last tx will sweep half or more of all outpoints from package
232
+ // Last transaction in a package needs to be a child of parents to get further in validation
233
+ // so the last transaction to be generated(in a >1 package) must spend all package-made outputs
234
+ // Note that this test currently only spends package outputs in last transaction.
235
+ bool last_tx = num_txs > 1 && txs.size () == num_txs - 1 ;
239
236
const auto num_in = outpoint_to_rbf ? 2 :
240
237
last_tx ? fuzzed_data_provider.ConsumeIntegralInRange <int >(package_outpoints.size ()/2 + 1 , package_outpoints.size ()) :
241
238
fuzzed_data_provider.ConsumeIntegralInRange <int >(1 , 4 );
@@ -377,18 +374,15 @@ FUZZ_TARGET(tx_package_eval, .init = initialize_tx_pool)
377
374
const auto num_txs = (size_t ) fuzzed_data_provider.ConsumeIntegralInRange <int >(1 , 26 );
378
375
std::set<COutPoint> package_outpoints;
379
376
while (txs.size () < num_txs) {
380
-
381
- // Last transaction in a package needs to be a child of parents to get further in validation
382
- // so the last transaction to be generated(in a >1 package) must spend all package-made outputs
383
- // Note that this test currently only spends package outputs in last transaction.
384
- bool last_tx = num_txs > 1 && txs.size () == num_txs - 1 ;
385
-
386
377
// Create transaction to add to the mempool
387
378
txs.emplace_back ([&] {
388
379
CMutableTransaction tx_mut;
389
380
tx_mut.version = fuzzed_data_provider.ConsumeBool () ? TRUC_VERSION : CTransaction::CURRENT_VERSION;
390
381
tx_mut.nLockTime = fuzzed_data_provider.ConsumeBool () ? 0 : fuzzed_data_provider.ConsumeIntegral <uint32_t >();
391
- // Last tx will sweep all outpoints in package
382
+ // Last transaction in a package needs to be a child of parents to get further in validation
383
+ // so the last transaction to be generated(in a >1 package) must spend all package-made outputs
384
+ // Note that this test currently only spends package outputs in last transaction.
385
+ bool last_tx = num_txs > 1 && txs.size () == num_txs - 1 ;
392
386
const auto num_in = last_tx ? package_outpoints.size () : fuzzed_data_provider.ConsumeIntegralInRange <int >(1 , mempool_outpoints.size ());
393
387
auto num_out = fuzzed_data_provider.ConsumeIntegralInRange <int >(1 , mempool_outpoints.size () * 2 );
394
388
0 commit comments