|
|
|
@ -2208,10 +2208,11 @@ bool CBlock::AcceptBlock(CValidationState &state, CDiskBlockPos *dbp)
|
|
|
|
|
if (pcheckpoint && nHeight < pcheckpoint->nHeight)
|
|
|
|
|
return state.DoS(100, error("AcceptBlock() : forked chain older than last checkpoint (height %d)", nHeight));
|
|
|
|
|
|
|
|
|
|
// Reject block.nVersion=1 blocks when 95% (75% on testnet) of the network has upgraded:
|
|
|
|
|
// Reject block.nVersion=1 blocks (mainnet >= 710000, testnet >= 400000)
|
|
|
|
|
if (nVersion < 2)
|
|
|
|
|
{
|
|
|
|
|
if (!fTestNet && nHeight >= 700000)
|
|
|
|
|
if ((!fTestNet && nHeight >= 710000) ||
|
|
|
|
|
(fTestNet && nHeight >= 400000))
|
|
|
|
|
{
|
|
|
|
|
return state.Invalid(error("AcceptBlock() : rejected nVersion=1 block"));
|
|
|
|
|
}
|
|
|
|
@ -2219,9 +2220,8 @@ bool CBlock::AcceptBlock(CValidationState &state, CDiskBlockPos *dbp)
|
|
|
|
|
// Enforce block.nVersion=2 rule that the coinbase starts with serialized block height
|
|
|
|
|
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)) ||
|
|
|
|
|
(fTestNet && CBlockIndex::IsSuperMajority(2, pindexPrev, 51, 100)))
|
|
|
|
|
if ((!fTestNet && nHeight >= 710000) ||
|
|
|
|
|
(fTestNet && nHeight >= 400000))
|
|
|
|
|
{
|
|
|
|
|
CScript expect = CScript() << nHeight;
|
|
|
|
|
if (vtx[0].vin[0].scriptSig.size() < expect.size() ||
|
|
|
|
|