|
|
@ -68,7 +68,7 @@ var ( |
|
|
|
// codebase, inherently breaking if the engine is swapped out. Please put common
|
|
|
|
// codebase, inherently breaking if the engine is swapped out. Please put common
|
|
|
|
// error types into the consensus package.
|
|
|
|
// error types into the consensus package.
|
|
|
|
var ( |
|
|
|
var ( |
|
|
|
errZeroBlockTime = errors.New("timestamp equals parent's") |
|
|
|
errOlderBlockTime = errors.New("timestamp older than parent") |
|
|
|
errTooManyUncles = errors.New("too many uncles") |
|
|
|
errTooManyUncles = errors.New("too many uncles") |
|
|
|
errDuplicateUncle = errors.New("duplicate uncle") |
|
|
|
errDuplicateUncle = errors.New("duplicate uncle") |
|
|
|
errUncleIsAncestor = errors.New("uncle is ancestor") |
|
|
|
errUncleIsAncestor = errors.New("uncle is ancestor") |
|
|
@ -255,9 +255,9 @@ func (ethash *Ethash) verifyHeader(chain consensus.ChainReader, header, parent * |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if header.Time <= parent.Time { |
|
|
|
if header.Time <= parent.Time { |
|
|
|
return errZeroBlockTime |
|
|
|
return errOlderBlockTime |
|
|
|
} |
|
|
|
} |
|
|
|
// Verify the block's difficulty based in its timestamp and parent's difficulty
|
|
|
|
// Verify the block's difficulty based on its timestamp and parent's difficulty
|
|
|
|
expected := ethash.CalcDifficulty(chain, header.Time, parent) |
|
|
|
expected := ethash.CalcDifficulty(chain, header.Time, parent) |
|
|
|
|
|
|
|
|
|
|
|
if expected.Cmp(header.Difficulty) != 0 { |
|
|
|
if expected.Cmp(header.Difficulty) != 0 { |
|
|
|