mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
[validation] distinguish same txid different wtxid in mempool
Changes behavior.
This commit is contained in:
parent
4129134e84
commit
fdb48163bf
1 changed files with 6 additions and 2 deletions
|
@ -587,9 +587,13 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
|
|||
if (!CheckFinalTx(m_active_chainstate.m_chain.Tip(), tx, STANDARD_LOCKTIME_VERIFY_FLAGS))
|
||||
return state.Invalid(TxValidationResult::TX_PREMATURE_SPEND, "non-final");
|
||||
|
||||
// is it already in the memory pool?
|
||||
if (m_pool.exists(hash)) {
|
||||
if (m_pool.exists(GenTxid(true, tx.GetWitnessHash()))) {
|
||||
// Exact transaction already exists in the mempool.
|
||||
return state.Invalid(TxValidationResult::TX_CONFLICT, "txn-already-in-mempool");
|
||||
} else if (m_pool.exists(GenTxid(false, tx.GetHash()))) {
|
||||
// Transaction with the same non-witness data but different witness (same txid, different
|
||||
// wtxid) already exists in the mempool.
|
||||
return state.Invalid(TxValidationResult::TX_CONFLICT, "txn-same-nonwitness-data-in-mempool");
|
||||
}
|
||||
|
||||
// Check for conflicts with in-memory transactions
|
||||
|
|
Loading…
Add table
Reference in a new issue