mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
consensus/beacon: clarify isPreMerge
This commit is contained in:
parent
0e4c13a62d
commit
c7e4e89a5f
1 changed files with 5 additions and 2 deletions
|
|
@ -72,9 +72,12 @@ func New(ethone consensus.Engine) *Beacon {
|
||||||
return &Beacon{ethone: ethone}
|
return &Beacon{ethone: ethone}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// isPreMerge reports whether the given block number is assumed to be pre-merge.
|
||||||
|
// Here we check the MergeNetsplitBlock to allow configuring networks with a PoW or
|
||||||
|
// PoA chain for unit testing purposes.
|
||||||
func isPreMerge(config *params.ChainConfig, block uint64) bool {
|
func isPreMerge(config *params.ChainConfig, block uint64) bool {
|
||||||
return !(config.TerminalTotalDifficulty != nil && config.TerminalTotalDifficulty.Sign() == 0) ||
|
mergedAtGenesis := config.TerminalTotalDifficulty != nil && config.TerminalTotalDifficulty.Sign() == 0
|
||||||
(config.MergeNetsplitBlock != nil && block < config.MergeNetsplitBlock.Uint64())
|
return !mergedAtGenesis && config.MergeNetsplitBlock != nil && block < config.MergeNetsplitBlock.Uint64()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Author implements consensus.Engine, returning the verified author of the block.
|
// Author implements consensus.Engine, returning the verified author of the block.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue