Merge fcfd37f3f9 into merged_master (Bitcoin PR bitcoin/bitcoin#22123)

Added a limit to the tx_pool and tx_pool_standard fuzztest loops,
not because it had anything to do with this PR, but because it was
causing long fuzztests runs and I happened to stop the merge script
here.
This commit is contained in:
Andrew Poelstra 2021-07-21 17:39:58 +00:00
commit f26f9a1e49
2 changed files with 5 additions and 3 deletions

View file

@ -142,7 +142,8 @@ FUZZ_TARGET_INIT(tx_pool_standard, initialize_tx_pool)
return c.out.nValue.GetAmount();
};
while (fuzzed_data_provider.ConsumeBool()) {
unsigned int limit = 300;
while (fuzzed_data_provider.ConsumeBool() && --limit) {
{
// Total supply is the mempool fee + all outpoints
CAmount supply_now{WITH_LOCK(tx_pool.cs, return tx_pool.GetTotalFee())};
@ -308,7 +309,8 @@ FUZZ_TARGET_INIT(tx_pool, initialize_tx_pool)
CTxMemPool tx_pool_{/* estimator */ nullptr, /* check_ratio */ 1};
MockedTxPool& tx_pool = *static_cast<MockedTxPool*>(&tx_pool_);
while (fuzzed_data_provider.ConsumeBool()) {
unsigned int limit = 300;
while (fuzzed_data_provider.ConsumeBool() && --limit) {
const auto mut_tx = ConsumeTransaction(fuzzed_data_provider, txids);
if (fuzzed_data_provider.ConsumeBool()) {