mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
params/config: address review concerns
This commit is contained in:
parent
da43f2c81f
commit
de424f357e
2 changed files with 3 additions and 3 deletions
|
|
@ -316,7 +316,7 @@ func (ethash *Ethash) CalcDifficulty(chain consensus.ChainReader, time uint64, p
|
||||||
func CalcDifficulty(config *params.ChainConfig, time uint64, parent *types.Header) *big.Int {
|
func CalcDifficulty(config *params.ChainConfig, time uint64, parent *types.Header) *big.Int {
|
||||||
next := new(big.Int).Add(parent.Number, big1)
|
next := new(big.Int).Add(parent.Number, big1)
|
||||||
switch {
|
switch {
|
||||||
case config.IsEip2384(next):
|
case config.IsMuirGlacier(next):
|
||||||
return calcDifficultyEip2384(time, parent)
|
return calcDifficultyEip2384(time, parent)
|
||||||
case config.IsConstantinople(next):
|
case config.IsConstantinople(next):
|
||||||
return calcDifficultyConstantinople(time, parent)
|
return calcDifficultyConstantinople(time, parent)
|
||||||
|
|
|
||||||
|
|
@ -384,8 +384,8 @@ func (c *ChainConfig) IsConstantinople(num *big.Int) bool {
|
||||||
return isForked(c.ConstantinopleBlock, num)
|
return isForked(c.ConstantinopleBlock, num)
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsEip2384 returns whether num is equal or greater than the EIP 2384 block
|
// IsMuirGlacier returns whether num is either equal to the Muir Glacier (EIP-2384) fork block or greater.
|
||||||
func (c *ChainConfig) IsEip2384(num *big.Int) bool {
|
func (c *ChainConfig) IsMuirGlacier(num *big.Int) bool {
|
||||||
return isForked(c.EIP2384Block, num)
|
return isForked(c.EIP2384Block, num)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue