Double spends do not create a reject message #4057

issue mikehearn openend this issue on April 15, 2014
  1. mikehearn commented at 11:33 am on April 15, 2014: contributor

    I wrote an app that sends two transactions which double spend the same output in a row. The second never generates a reject message, because we end up in the dead “replace tx” codepath which returns false and doesn’t even log anything, so the tx disappears silently. I think if that codepath is taken out or just #defined out so it’s clear where the fixed code should go once done, then it will fall through to the other checks below.

    However then we have a second problem, which is that if all the tx outputs are spent already, it also won’t trigger a reject message because it will hit the block starting with

    0    // do all inputs exist?
    

    and end up failing to find the CCoins, so again, no reject message.

  2. dgenr8 commented at 3:33 pm on April 15, 2014: contributor
    @mikehearn Why not just add a reject message before return false? Note #3883 uses this code block too.
  3. mikehearn commented at 9:34 pm on April 29, 2014: contributor
    I think the issue is telling apart orphans from double spends.
  4. dgenr8 commented at 10:51 pm on April 29, 2014: contributor
    It looks like this later return false should also issue a reject message “Not all inputs are known”. Presuming the respend is more serious, the semantics of this check being later are correct.
  5. laanwj added the label Improvement on May 2, 2014
  6. laanwj added the label Feature on Feb 9, 2016
  7. laanwj added the label P2P on Feb 9, 2016
  8. laanwj removed the label Refactoring on Feb 9, 2016
  9. laanwj commented at 4:52 pm on February 9, 2016: member
    As of #6519 there is a REJECT_CONFLICT txn-mempool-conflict, however it is not sent over the P2P network, only over RPC, as no reject code has been defined in the BIP. Exposing this would require updating or creating a supplement to bip-0061.
  10. MarcoFalke commented at 0:12 am on June 24, 2018: member
    I believe reject messages have been deprecated? If so, this feature request is no longer applicable and could potentially be closed.
  11. laanwj closed this on Mar 18, 2019

  12. MarcoFalke locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-18 03:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me