diff --git a/common/math/big.go b/common/math/big.go index 5f62b010fa..fd0174b366 100644 --- a/common/math/big.go +++ b/common/math/big.go @@ -27,8 +27,8 @@ var ( tt256 = BigPow(2, 256) tt256m1 = new(big.Int).Sub(tt256, big.NewInt(1)) MaxBig256 = new(big.Int).Set(tt256m1) - tt63 = BigPow(2,63) - TT63m1 = new(big.Int).Sub(tt63,big.NewInt(1)) + tt63 = BigPow(2, 63) + MaxBig63 = new(big.Int).Sub(tt63, big.NewInt(1)) ) const ( diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go index f461fabd6b..cc8413482d 100644 --- a/consensus/ethash/consensus.go +++ b/consensus/ethash/consensus.go @@ -244,12 +244,12 @@ func (ethash *Ethash) verifyHeader(chain consensus.ChainReader, header, parent * return fmt.Errorf("invalid difficulty: have %v, want %v", header.Difficulty, expected) } // Verify that the gas limit is < 2^63-1 - if header.GasLimit.Cmp(math.TT63m1) > 0{ - return fmt.Errorf("invalid gasLimit: have %v, max %v", header.GasLimit, math.TT63m1) + if header.GasLimit.Cmp(math.MaxBig63) > 0 { + return fmt.Errorf("invalid gasLimit: have %v, max %v", header.GasLimit, math.MaxBig63) } // Verify that the gasUsed is <= gasLimit - if header.GasUsed.Cmp(header.GasLimit) > 0{ - return fmt.Errorf("invalid gasUsed: have %v, gasLimit %v", header.GasUsed, header.GasLimit) + if header.GasUsed.Cmp(header.GasLimit) > 0 { + return fmt.Errorf("invalid gasUsed: have %v, gasLimit %v", header.GasUsed, header.GasLimit) } // Verify that the gas limit remains within allowed bounds