bitcoin/bitcoin — pull request #915 by sipa (2012-03-03 16:11:49+00:00)
Title: Do not allow overwriting unspent transactions

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.