| 174 | } |
| 175 | |
| 176 | std::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 | |
| 194 | void CheckATMPInvariants(const MempoolAcceptResult& res, bool txid_in_mempool, bool wtxid_in_mempool) |
| 195 | { |
no test coverage detected