diff options
author | Luke Dashjr <luke-jr+git@utopios.org> | 2012-08-26 22:19:46 +0000 |
---|---|---|
committer | Luke Dashjr <luke-jr+git@utopios.org> | 2012-08-26 22:19:46 +0000 |
commit | 680c3c85659b2b5f98fbcb4b56d18a4f283598dd (patch) | |
tree | d0b2d338d30a22dd641e9b3bac5cc875a678ac41 /src/main.cpp | |
parent | 4c063c11ff1dde6998a36212c5ebf399af236f78 (diff) | |
parent | 689b878c33e41df0bd692ac3189a0e2089abf8bf (diff) | |
download | bitcoin-680c3c85659b2b5f98fbcb4b56d18a4f283598dd.tar.xz |
Merge commit '689b878' into 0.6.0.x
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 5acf5b97d4..7d3432751a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1748,8 +1748,17 @@ bool CBlock::AcceptBlock() if (!Checkpoints::CheckBlock(nHeight, hash)) return DoS(100, error("AcceptBlock() : rejected by checkpoint lockin at %d", nHeight)); + // Reject block.nVersion=1 blocks when 95% (75% on testnet) of the network has upgraded: + if (nVersion < 2) + { + if ((!fTestNet && CBlockIndex::IsSuperMajority(2, pindexPrev, 950, 1000)) || + (fTestNet && CBlockIndex::IsSuperMajority(2, pindexPrev, 75, 100))) + { + return error("AcceptBlock() : rejected nVersion=1 block"); + } + } // Enforce block.nVersion=2 rule that the coinbase starts with serialized block height - if (nVersion > 1) + if (nVersion >= 2) { // if 750 of the last 1,000 blocks are version 2 or greater (51/100 if testnet): if ((!fTestNet && CBlockIndex::IsSuperMajority(2, pindexPrev, 750, 1000)) || |