mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-05 02:33:07 +02:00
[[refactor]] Check CTxMemPool options in constructor
This ensures that the tests run the same checks on the mempool options that the init code also applies.
This commit is contained in:
@@ -7,11 +7,13 @@
|
||||
#include <test/util/txmempool.h>
|
||||
#include <test/util/mining.h>
|
||||
|
||||
#include <node/mini_miner.h>
|
||||
#include <node/miner.h>
|
||||
#include <node/mini_miner.h>
|
||||
#include <primitives/transaction.h>
|
||||
#include <random.h>
|
||||
#include <txmempool.h>
|
||||
#include <util/check.h>
|
||||
#include <util/translation.h>
|
||||
|
||||
#include <deque>
|
||||
#include <vector>
|
||||
@@ -33,7 +35,9 @@ void initialize_miner()
|
||||
FUZZ_TARGET(mini_miner, .init = initialize_miner)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||
CTxMemPool pool{CTxMemPool::Options{}};
|
||||
bilingual_str error;
|
||||
CTxMemPool pool{CTxMemPool::Options{}, error};
|
||||
Assert(error.empty());
|
||||
std::vector<COutPoint> outpoints;
|
||||
std::deque<COutPoint> available_coins = g_available_coins;
|
||||
LOCK2(::cs_main, pool.cs);
|
||||
@@ -109,7 +113,9 @@ FUZZ_TARGET(mini_miner, .init = initialize_miner)
|
||||
FUZZ_TARGET(mini_miner_selection, .init = initialize_miner)
|
||||
{
|
||||
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
|
||||
CTxMemPool pool{CTxMemPool::Options{}};
|
||||
bilingual_str error;
|
||||
CTxMemPool pool{CTxMemPool::Options{}, error};
|
||||
Assert(error.empty());
|
||||
// Make a copy to preserve determinism.
|
||||
std::deque<COutPoint> available_coins = g_available_coins;
|
||||
std::vector<CTransactionRef> transactions;
|
||||
|
||||
Reference in New Issue
Block a user