| 22 | } |
| 23 | |
| 24 | FUZZ_TARGET_INIT(rbf, initialize_rbf) |
| 25 | { |
| 26 | FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size()); |
| 27 | SetMockTime(ConsumeTime(fuzzed_data_provider)); |
| 28 | std::optional<CMutableTransaction> mtx = ConsumeDeserializable<CMutableTransaction>(fuzzed_data_provider); |
| 29 | if (!mtx) { |
| 30 | return; |
| 31 | } |
| 32 | CTxMemPool pool; |
| 33 | LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 10000) { |
| 34 | const std::optional<CMutableTransaction> another_mtx = ConsumeDeserializable<CMutableTransaction>(fuzzed_data_provider); |
| 35 | if (!another_mtx) { |
| 36 | break; |
| 37 | } |
| 38 | const CTransaction another_tx{*another_mtx}; |
| 39 | if (fuzzed_data_provider.ConsumeBool() && !mtx->vin.empty()) { |
| 40 | mtx->vin[0].prevout = COutPoint{another_tx.GetHash(), 0}; |
| 41 | } |
| 42 | LOCK2(cs_main, pool.cs); |
| 43 | pool.addUnchecked(ConsumeTxMemPoolEntry(fuzzed_data_provider, another_tx)); |
| 44 | } |
| 45 | const CTransaction tx{*mtx}; |
| 46 | if (fuzzed_data_provider.ConsumeBool()) { |
| 47 | LOCK2(cs_main, pool.cs); |
| 48 | pool.addUnchecked(ConsumeTxMemPoolEntry(fuzzed_data_provider, tx)); |
| 49 | } |
| 50 | { |
| 51 | LOCK(pool.cs); |
| 52 | (void)IsRBFOptIn(tx, pool); |
| 53 | } |
| 54 | } |
nothing calls this directly
no test coverage detected