|
@@ -53,7 +53,6 @@ var (
|
|
|
errDuplicateUncle = errors.New("duplicate uncle")
|
|
errDuplicateUncle = errors.New("duplicate uncle")
|
|
|
errUncleIsAncestor = errors.New("uncle is ancestor")
|
|
errUncleIsAncestor = errors.New("uncle is ancestor")
|
|
|
errDanglingUncle = errors.New("uncle's parent is not ancestor")
|
|
errDanglingUncle = errors.New("uncle's parent is not ancestor")
|
|
|
- errNonceOutOfRange = errors.New("nonce out of range")
|
|
|
|
|
errInvalidDifficulty = errors.New("non-positive difficulty")
|
|
errInvalidDifficulty = errors.New("non-positive difficulty")
|
|
|
errInvalidMixDigest = errors.New("invalid mix digest")
|
|
errInvalidMixDigest = errors.New("invalid mix digest")
|
|
|
errInvalidPoW = errors.New("invalid proof-of-work")
|
|
errInvalidPoW = errors.New("invalid proof-of-work")
|
|
@@ -474,18 +473,13 @@ func (ethash *Ethash) VerifySeal(chain consensus.ChainReader, header *types.Head
|
|
|
if ethash.shared != nil {
|
|
if ethash.shared != nil {
|
|
|
return ethash.shared.VerifySeal(chain, header)
|
|
return ethash.shared.VerifySeal(chain, header)
|
|
|
}
|
|
}
|
|
|
- // Sanity check that the block number is below the lookup table size (60M blocks)
|
|
|
|
|
- number := header.Number.Uint64()
|
|
|
|
|
- if number/epochLength >= maxEpoch {
|
|
|
|
|
- // Go < 1.7 cannot calculate new cache/dataset sizes (no fast prime check)
|
|
|
|
|
- return errNonceOutOfRange
|
|
|
|
|
- }
|
|
|
|
|
// Ensure that we have a valid difficulty for the block
|
|
// Ensure that we have a valid difficulty for the block
|
|
|
if header.Difficulty.Sign() <= 0 {
|
|
if header.Difficulty.Sign() <= 0 {
|
|
|
return errInvalidDifficulty
|
|
return errInvalidDifficulty
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
// Recompute the digest and PoW value and verify against the header
|
|
// Recompute the digest and PoW value and verify against the header
|
|
|
|
|
+ number := header.Number.Uint64()
|
|
|
|
|
+
|
|
|
cache := ethash.cache(number)
|
|
cache := ethash.cache(number)
|
|
|
size := datasetSize(number)
|
|
size := datasetSize(number)
|
|
|
if ethash.config.PowMode == ModeTest {
|
|
if ethash.config.PowMode == ModeTest {
|