This commit is contained in:
Evan Duffield 2014-05-17 10:26:09 -07:00
commit 467f7db2c9
2 changed files with 14 additions and 31 deletions

View File

@ -42,10 +42,12 @@ namespace Checkpoints
( 23912, uint256("0x0000000000335eac6703f3b1732ec8b2f89c3ba3a7889e5767b090556bb9a276"))
( 35457, uint256("0x0000000000b0ae211be59b048df14820475ad0dd53b9ff83b010f71a77342d9f"))
( 45479, uint256("0x000000000063d411655d590590e16960f15ceea4257122ac430c6fbe39fbf02d"))
( 55895, uint256("0x0000000000ae4c53a43639a4ca027282f69da9c67ba951768a20415b6439a2d7"))
( 68899, uint256("0x0000000000194ab4d3d9eeb1f2f792f21bb39ff767cb547fe977640f969d77b7"))
;
static const CCheckpointData data = {
&mapCheckpoints,
1393373461, // * UNIX timestamp of last checkpoint block
1400148293, // * UNIX timestamp of last checkpoint block
25000, // * total number of transactions between genesis and last checkpoint
// (the tx=... number in the SetBestChain debug.log lines)
800.0 // * estimated number of transactions per day after checkpoint

View File

@ -2744,37 +2744,18 @@ bool CBlock::AcceptBlock(CValidationState &state, CDiskBlockPos *dbp)
if (nBits != GetNextWorkRequired(pindexPrev, this))
return state.DoS(100, error("AcceptBlock() : incorrect proof of work"));
} else {
#ifdef _WIN32
// Check proof of work
if(nHeight >= 34140){
unsigned int nBitsNext = GetNextWorkRequired(pindexPrev, this);
double n1 = ConvertBitsToDouble(nBits);
double n2 = ConvertBitsToDouble(nBitsNext);
// Check proof of work (Here for the architecture issues with DGW v1 and v2)
if(nHeight <= 68589){
unsigned int nBitsNext = GetNextWorkRequired(pindexPrev, this);
double n1 = ConvertBitsToDouble(nBits);
double n2 = ConvertBitsToDouble(nBitsNext);
if (nHeight <= 45000) {
if (abs(n1-n2) > n1*0.2)
return state.DoS(100, error("AcceptBlock() : incorrect proof of work (DGW pre-fork)"));
} else {
if (abs(n1-n2) > n1*0.005)
return state.DoS(100, error("AcceptBlock() : incorrect proof of work (DGW2)"));
}
} else {
if (nBits != GetNextWorkRequired(pindexPrev, this))
return state.DoS(100, error("AcceptBlock() : incorrect proof of work"));
}
#else
// Check proof of work
if(nHeight >= 34140 && nHeight <= 45000){
unsigned int nBitsNext = GetNextWorkRequired(pindexPrev, this);
double n1 = ConvertBitsToDouble(nBits);
double n2 = ConvertBitsToDouble(nBitsNext);
if (abs(n1-n2) > n1*0.2)
return state.DoS(100, error("AcceptBlock() : incorrect proof of work (DGW pre-fork)"));
} else {
if (nBits != GetNextWorkRequired(pindexPrev, this))
return state.DoS(100, error("AcceptBlock() : incorrect proof of work"));
}
#endif
if (abs(n1-n2) > n1*0.2)
return state.DoS(100, error("AcceptBlock() : incorrect proof of work (DGW pre-fork)"));
} else {
if (nBits != GetNextWorkRequired(pindexPrev, this))
return state.DoS(100, error("AcceptBlock() : incorrect proof of work"));
}
}
// Prevent blocks from too far in the future