mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 07:06:42 +00:00
math/big: rename TTM63m1 -> MaxBig63, + go fmt
This commit is contained in:
parent
124af830ff
commit
764c2520c3
2 changed files with 6 additions and 6 deletions
|
|
@ -27,8 +27,8 @@ var (
|
||||||
tt256 = BigPow(2, 256)
|
tt256 = BigPow(2, 256)
|
||||||
tt256m1 = new(big.Int).Sub(tt256, big.NewInt(1))
|
tt256m1 = new(big.Int).Sub(tt256, big.NewInt(1))
|
||||||
MaxBig256 = new(big.Int).Set(tt256m1)
|
MaxBig256 = new(big.Int).Set(tt256m1)
|
||||||
tt63 = BigPow(2,63)
|
tt63 = BigPow(2, 63)
|
||||||
TT63m1 = new(big.Int).Sub(tt63,big.NewInt(1))
|
MaxBig63 = new(big.Int).Sub(tt63, big.NewInt(1))
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
||||||
|
|
@ -244,11 +244,11 @@ func (ethash *Ethash) verifyHeader(chain consensus.ChainReader, header, parent *
|
||||||
return fmt.Errorf("invalid difficulty: have %v, want %v", header.Difficulty, expected)
|
return fmt.Errorf("invalid difficulty: have %v, want %v", header.Difficulty, expected)
|
||||||
}
|
}
|
||||||
// Verify that the gas limit is < 2^63-1
|
// Verify that the gas limit is < 2^63-1
|
||||||
if header.GasLimit.Cmp(math.TT63m1) > 0{
|
if header.GasLimit.Cmp(math.MaxBig63) > 0 {
|
||||||
return fmt.Errorf("invalid gasLimit: have %v, max %v", header.GasLimit, math.TT63m1)
|
return fmt.Errorf("invalid gasLimit: have %v, max %v", header.GasLimit, math.MaxBig63)
|
||||||
}
|
}
|
||||||
// Verify that the gasUsed is <= gasLimit
|
// Verify that the gasUsed is <= gasLimit
|
||||||
if header.GasUsed.Cmp(header.GasLimit) > 0{
|
if header.GasUsed.Cmp(header.GasLimit) > 0 {
|
||||||
return fmt.Errorf("invalid gasUsed: have %v, gasLimit %v", header.GasUsed, header.GasLimit)
|
return fmt.Errorf("invalid gasUsed: have %v, gasLimit %v", header.GasUsed, header.GasLimit)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue