| 91 | } |
| 92 | |
| 93 | void Finish(FuzzedDataProvider& fuzzed_data_provider, MockedTxPool& tx_pool, CChainState& chainstate) |
| 94 | { |
| 95 | WITH_LOCK(::cs_main, tx_pool.check(chainstate.m_chain.Tip(), chainstate.CoinsTip(), chainstate.m_chain.Height() + 1)); |
| 96 | { |
| 97 | BlockAssembler::Options options; |
| 98 | options.nBlockMaxWeight = fuzzed_data_provider.ConsumeIntegralInRange(0U, MAX_BLOCK_WEIGHT); |
| 99 | options.blockMinFeeRate = CFeeRate{ConsumeMoney(fuzzed_data_provider, /*max=*/COIN)}; |
| 100 | auto assembler = BlockAssembler{chainstate, *static_cast<CTxMemPool*>(&tx_pool), chainstate.m_params, options}; |
| 101 | auto block_template = assembler.CreateNewBlock(CScript{} << OP_TRUE); |
| 102 | Assert(block_template->block.vtx.size() >= 1); |
| 103 | } |
| 104 | const auto info_all = tx_pool.infoAll(); |
| 105 | if (!info_all.empty()) { |
| 106 | const auto& tx_to_remove = *PickValue(fuzzed_data_provider, info_all).tx; |
| 107 | WITH_LOCK(tx_pool.cs, tx_pool.removeRecursive(tx_to_remove, MemPoolRemovalReason::BLOCK /* dummy */)); |
| 108 | std::vector<uint256> all_txids; |
| 109 | tx_pool.queryHashes(all_txids); |
| 110 | assert(all_txids.size() < info_all.size()); |
| 111 | WITH_LOCK(::cs_main, tx_pool.check(chainstate.m_chain.Tip(), chainstate.CoinsTip(), chainstate.m_chain.Height() + 1)); |
| 112 | } |
| 113 | SyncWithValidationInterfaceQueue(); |
| 114 | } |
| 115 | |
| 116 | void MockTime(FuzzedDataProvider& fuzzed_data_provider, const CChainState& chainstate) |
| 117 | { |
no test coverage detected