File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -587,9 +587,13 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
587
587
if (!CheckFinalTx (m_active_chainstate.m_chain .Tip (), tx, STANDARD_LOCKTIME_VERIFY_FLAGS))
588
588
return state.Invalid (TxValidationResult::TX_PREMATURE_SPEND, " non-final" );
589
589
590
- // is it already in the memory pool?
591
- if (m_pool. exists (hash)) {
590
+ if (m_pool. exists ( GenTxid ( true , tx. GetWitnessHash ()))) {
591
+ // Exact transaction already exists in the mempool.
592
592
return state.Invalid (TxValidationResult::TX_CONFLICT, " txn-already-in-mempool" );
593
+ } else if (m_pool.exists (GenTxid (false , tx.GetHash ()))) {
594
+ // Transaction with the same non-witness data but different witness (same txid, different
595
+ // wtxid) already exists in the mempool.
596
+ return state.Invalid (TxValidationResult::TX_CONFLICT, " txn-same-nonwitness-data-in-mempool" );
593
597
}
594
598
595
599
// Check for conflicts with in-memory transactions
You can’t perform that action at this time.
0 commit comments