On master, if you submit a transaction with the same txid but different witness to the mempool, it thinks the transactions are the same. Users submitting through BroadcastTransaction()
(i.e. sendrawtransaction
or the wallet) don’t get notified that there’s a different transaction in the mempool, although it doesn’t crash. Users submitting through testmempoolaccept()
will get a “txn-already-in-mempool” error.
This PR simply distinguishes between txn-already-in-mempool
and txn-same-nonwitness-data-in-mempool
, without handling them differently: sendrawtransaction
still will not throw, but testmempoolaccept
will give you a different error.
I believe the intention of #19645 is to allow full swaps of transactions that have different witnesses but identical nonwitness data. Returning a different error message + adding a test was suggested: #19645 (comment) so this is that PR.