1

I'm trying to clear up some uncertainties around the mempool

A tx comes in, its validated, and no other transactions have currently marked any of its inputs. Tx gets added to mempool.

If a double spend comes in (i.e a tx that uses any marked inputs it is discarded, maybe we mark it as a double spend attempt.

If a block is committed, any txs in the mempool referencing spent inputs are removed from the mempool. If the Tx being removed is not equivalent to the one being added that Tx is marked as an orphan (if you wanted tx orphan tracking)

If a block is rolled back, consumed unspents are restored, tx is added back into mempool as unconfirmed.

Is that roughly correct? I feel like there are some edge cases around mempool and block roll back that this doesn't address.

  • Transactions spending outputs already spent by another transaction in the mempool are just rejected. – Anonymous Jun 22 '15 at 23:34
  • @Bitcoin: Bitcoin-XT apparently collects them and marks them as a double spend attempt. – Murch Jun 23 '15 at 7:37
  • 1
    @Murch Just an FYI, Tom Harding's patches (as incorporated into Bitcoin XT and also Bitcoin Core for a very short time) not only track double spend attempts and notify the user if appropriate, they relay them to other nodes so that others are also aware of them (assuming of course the double-spend isn't sent directly to a miner which doesn't do double-spend relaying). – Christopher Gurnee Jun 23 '15 at 18:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.