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

Function MakeMempool

src/test/fuzz/tx_pool.cpp:176–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176std::unique_ptr<CTxMemPool> MakeMempool(FuzzedDataProvider& fuzzed_data_provider, const NodeContext& node)
177{
178 // Take the default options for tests...
179 CTxMemPool::Options mempool_opts{MemPoolOptionsForTest(node)};
180
181 // ...override specific options for this specific fuzz suite
182 mempool_opts.check_ratio = 1;
183 mempool_opts.require_standard = fuzzed_data_provider.ConsumeBool();
184
185 // ...and construct a CTxMemPool from it
186 bilingual_str error;
187 auto mempool{std::make_unique<CTxMemPool>(std::move(mempool_opts), error)};
188 // ... ignore the error since it might be beneficial to fuzz even when the
189 // mempool size is unreasonably small
190 Assert(error.empty() || error.original.starts_with("-maxmempool must be at least "));
191 return mempool;
192}
193
194void CheckATMPInvariants(const MempoolAcceptResult& res, bool txid_in_mempool, bool wtxid_in_mempool)
195{

Callers 4

tx_pool.cppFile · 0.70
TestPackageSelectionMethod · 0.50
TestBasicMiningMethod · 0.50
TestPrioritisedMiningMethod · 0.50

Calls 3

MemPoolOptionsForTestFunction · 0.85
ConsumeBoolMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected