Check for duplicate txins in CheckTransaction. #443

pull TheBlueMatt wants to merge 1 commits into bitcoin:master from TheBlueMatt:dupin changing 1 files +9 −0
  1. TheBlueMatt commented at 12:20 pm on July 31, 2011: member
    These should be invalid.
  2. Check for duplicate txins in CheckTransaction. 33208fb557
  3. groffer commented at 10:03 pm on August 2, 2011: none
    CheckBlock calls this function. Won’t this cause a fork in the blockchain if the network doesn’t upgrade as a whole and a transaction that runs afoul of this check is included in a block?
  4. sipa commented at 10:07 pm on August 2, 2011: member
    Such a transaction should already cause the block it is included in to be invalid, as ConnectInputs will detect the duplicate use of the same prevout. This patch just causes such cases to be detected in an earlier stage, before it enters the memory pool.
  5. TheBlueMatt commented at 10:12 pm on August 2, 2011: member
    If a transaction with a duplicate input is in a block, the chain should be forked (or people are making money out of nothing). Also, no transactions with duplicate inputs get put in blocks…someone tried it a couple weeks ago, but the txes never ended up in blocks. Im assuming there is a check somewhere later on that prevented them from getting added to a block, though I haven’t done any digging on the matter. This is really to prevent such obviously invalid transactions from getting relayed.
  6. groffer commented at 10:19 pm on August 2, 2011: none
    Right, looks like the vSpent check in ConnectInputs takes care of it.
  7. gavinandresen referenced this in commit 4e5d88ce26 on Aug 8, 2011
  8. gavinandresen merged this on Aug 8, 2011
  9. gavinandresen closed this on Aug 8, 2011

  10. dexX7 referenced this in commit c637a27dd7 on Jan 9, 2017
  11. ptschip referenced this in commit fd9ccdef13 on Apr 19, 2017
  12. kallewoof referenced this in commit e63e500658 on Oct 4, 2019
  13. rajarshimaitra referenced this in commit 2d076f1420 on Aug 5, 2021
  14. DrahtBot locked this on Sep 8, 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-12-19 09:12 UTC

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