Do not allow overwriting unspent transactions #915

pull sipa wants to merge 1 commits into bitcoin:master from sipa:nooverwritetx changing 1 files +24 −2
  1. sipa commented at 4:11 PM on March 3, 2012: member

    Introduce the following network rule for blocks after march 15, 2012:

    • a block is not valid if it contains a transaction whose hash already exists in the block chain, unless all that transaction's outputs were already spent before said block.

    Warning: this is effectively a network rule change, with potential risk for forking the block chain. Leaving this unfixed carries the same risk however, for attackers that can cause a reorganisation in part of the network.

    Thanks to Russell O'Connor and Ben Reeves.

  2. in src/main.cpp:None in f955662da9 outdated
    1250 | +    // being sent to another address.
    1251 | +    // See http://r6.ca/blog/20120206T005236Z.html for more information.
    1252 | +    // This logic is not necessary for memory pool transactions, as AcceptToMemoryPool
    1253 | +    // already refuses previously-known transaction id's entirely.
    1254 | +    // This rule applies to all blocks whose timestamp is after March 15, 2012, 0:00 UTC.
    1255 | +    if (pindex->nTime > 1331769600)
    


    gavinandresen commented at 4:57 PM on March 3, 2012:

    Should you make it fTestNet || ... so it is running on testnet for a while before the switch on main net?


    sipa commented at 4:59 PM on March 3, 2012:

    That's possible, but enabling it for every block on testnet, will cause the current testnet chain to become invalid. I prefer switching testnet somewhere in the past, but after roconnor's tests.

  3. sipa commented at 5:22 PM on March 3, 2012: member

    Updated: enable on testnet since februari 20.

  4. Do not allow overwriting unspent transactions (BIP 30)
    Introduce the following network rule:
     * a block is not valid if it contains a transaction whose hash
       already exists in the block chain, unless all that transaction's
       outputs were already spent before said block.
    
    Warning: this is effectively a network rule change, with potential
    risk for forking the block chain. Leaving this unfixed carries the
    same risk however, for attackers that can cause a reorganisation
    in part of the network.
    
    Thanks to Russell O'Connor and Ben Reeves.
    a206b0ea12
  5. gavinandresen referenced this in commit f2e81bad33 on Mar 3, 2012
  6. gavinandresen merged this on Mar 3, 2012
  7. gavinandresen closed this on Mar 3, 2012

  8. coblee referenced this in commit 74157b6d78 on Jul 17, 2012
  9. suprnurd referenced this in commit ee17056ddc on Dec 5, 2017
  10. lateminer referenced this in commit 9c5a300624 on Oct 30, 2019
  11. DrahtBot locked this on Sep 8, 2021
Contributors

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: 2026-04-19 09:16 UTC

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