aboutsummaryrefslogtreecommitdiffstats
path: root/consensus/ethash/consensus.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-02-28 00:25:56 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-02-28 00:25:56 +0800
commit17b0e226d3d6b3829a82ee1c142bd125cc9a0109 (patch)
treecbb284467bb1f59d8397c2430ab34722a05c4478 /consensus/ethash/consensus.go
parentb574b5776695eb30e034fd8c7a468b3f03d4c6b9 (diff)
downloadgo-tangerine-17b0e226d3d6b3829a82ee1c142bd125cc9a0109.tar
go-tangerine-17b0e226d3d6b3829a82ee1c142bd125cc9a0109.tar.gz
go-tangerine-17b0e226d3d6b3829a82ee1c142bd125cc9a0109.tar.bz2
go-tangerine-17b0e226d3d6b3829a82ee1c142bd125cc9a0109.tar.lz
go-tangerine-17b0e226d3d6b3829a82ee1c142bd125cc9a0109.tar.xz
go-tangerine-17b0e226d3d6b3829a82ee1c142bd125cc9a0109.tar.zst
go-tangerine-17b0e226d3d6b3829a82ee1c142bd125cc9a0109.zip
travis, build, consensus: drop support for Go 1.7
Diffstat (limited to 'consensus/ethash/consensus.go')
-rw-r--r--consensus/ethash/consensus.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go
index 92a23d4a4..3f860bf47 100644
--- a/consensus/ethash/consensus.go
+++ b/consensus/ethash/consensus.go
@@ -53,7 +53,6 @@ var (
errDuplicateUncle = errors.New("duplicate uncle")
errUncleIsAncestor = errors.New("uncle is ancestor")
errDanglingUncle = errors.New("uncle's parent is not ancestor")
- errNonceOutOfRange = errors.New("nonce out of range")
errInvalidDifficulty = errors.New("non-positive difficulty")
errInvalidMixDigest = errors.New("invalid mix digest")
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 {
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
if header.Difficulty.Sign() <= 0 {
return errInvalidDifficulty
}
-
// Recompute the digest and PoW value and verify against the header
+ number := header.Number.Uint64()
+
cache := ethash.cache(number)
size := datasetSize(number)
if ethash.config.PowMode == ModeTest {