@@ -296,7 +296,6 @@ FUZZ_TARGET(tx_pool_standard, .init = initialize_tx_pool)
296296 std::set<CTransactionRef> added;
297297 auto txr = std::make_shared<TransactionsDelta>(removed, added);
298298 node.validation_signals ->RegisterSharedValidationInterface (txr);
299- const bool bypass_limits = fuzzed_data_provider.ConsumeBool ();
300299
301300 // Make sure ProcessNewPackage on one transaction works.
302301 // The result is not guaranteed to be the same as what is returned by ATMP.
@@ -311,7 +310,7 @@ FUZZ_TARGET(tx_pool_standard, .init = initialize_tx_pool)
311310 it->second .m_result_type == MempoolAcceptResult::ResultType::INVALID);
312311 }
313312
314- const auto res = WITH_LOCK (::cs_main, return AcceptToMemoryPool (chainstate, tx, GetTime (), bypass_limits, /* test_accept=*/ false ));
313+ const auto res = WITH_LOCK (::cs_main, return AcceptToMemoryPool (chainstate, tx, GetTime (), /* bypass_limits= */ false , /* test_accept=*/ false ));
315314 const bool accepted = res.m_result_type == MempoolAcceptResult::ResultType::VALID;
316315 node.validation_signals ->SyncWithValidationInterfaceQueue ();
317316 node.validation_signals ->UnregisterSharedValidationInterface (txr);
@@ -394,6 +393,9 @@ FUZZ_TARGET(tx_pool, .init = initialize_tx_pool)
394393
395394 chainstate.SetMempool (&tx_pool);
396395
396+ // If we ever bypass limits, do not do TRUC invariants checks
397+ bool ever_bypassed_limits{false };
398+
397399 LIMITED_WHILE (fuzzed_data_provider.ConsumeBool (), 300 )
398400 {
399401 const auto mut_tx = ConsumeTransaction (fuzzed_data_provider, txids);
@@ -412,13 +414,17 @@ FUZZ_TARGET(tx_pool, .init = initialize_tx_pool)
412414 tx_pool.PrioritiseTransaction (txid, delta);
413415 }
414416
417+ const bool bypass_limits{fuzzed_data_provider.ConsumeBool ()};
418+ ever_bypassed_limits |= bypass_limits;
419+
415420 const auto tx = MakeTransactionRef (mut_tx);
416- const bool bypass_limits = fuzzed_data_provider.ConsumeBool ();
417421 const auto res = WITH_LOCK (::cs_main, return AcceptToMemoryPool (chainstate, tx, GetTime (), bypass_limits, /* test_accept=*/ false ));
418422 const bool accepted = res.m_result_type == MempoolAcceptResult::ResultType::VALID;
419423 if (accepted) {
420424 txids.push_back (tx->GetHash ());
421- CheckMempoolTRUCInvariants (tx_pool);
425+ if (!ever_bypassed_limits) {
426+ CheckMempoolTRUCInvariants (tx_pool);
427+ }
422428 }
423429 }
424430 Finish (fuzzed_data_provider, tx_pool, chainstate);
0 commit comments