mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05:00
Merge bitcoin/bitcoin#29990: fuzz: don't allow adding duplicate transactions to the mempool
cc15c5bfd1
fuzz: don't allow adding duplicate transactions to the mempool (Suhas Daftuar) Pull request description: Filter duplicate transaction ids from being added to the mempool in the `partially_downloaded_block` fuzz target. I think a prerequisite for calling `CTxMemPool::addUnchecked` should be that the underlying txid doesn't already exist in the mempool (otherwise `addUnchecked` would need a way to return failure, which we don't currently have). ACKs for top commit: glozow: utACKcc15c5bfd1
makes sense to me maflcko: lgtm ACKcc15c5bfd1
brunoerg: ACKcc15c5bfd1
dergoegge: utACKcc15c5bfd1
Tree-SHA512: 85f84ce405aba584e6d00391515f0a86c5648ce8b2da69036e50a6c1f6833d050d09b1972cc5ffbe7c4edb3e5f7f965ef34bd839deeddac27a889cc8d2e53b8f
This commit is contained in:
commit
36e660fc23
1 changed files with 1 additions and 1 deletions
|
@ -72,7 +72,7 @@ FUZZ_TARGET(partially_downloaded_block, .init = initialize_pdb)
|
|||
available.insert(i);
|
||||
}
|
||||
|
||||
if (add_to_mempool) {
|
||||
if (add_to_mempool && !pool.exists(GenTxid::Txid(tx->GetHash()))) {
|
||||
LOCK2(cs_main, pool.cs);
|
||||
pool.addUnchecked(ConsumeTxMemPoolEntry(fuzzed_data_provider, *tx));
|
||||
available.insert(i);
|
||||
|
|
Loading…
Add table
Reference in a new issue