aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2012-08-26 22:19:46 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2012-08-26 22:19:46 +0000
commit680c3c85659b2b5f98fbcb4b56d18a4f283598dd (patch)
treed0b2d338d30a22dd641e9b3bac5cc875a678ac41 /src/main.cpp
parent4c063c11ff1dde6998a36212c5ebf399af236f78 (diff)
parent689b878c33e41df0bd692ac3189a0e2089abf8bf (diff)
downloadbitcoin-680c3c85659b2b5f98fbcb4b56d18a4f283598dd.tar.xz
Merge commit '689b878' into 0.6.0.x
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp11
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)) ||