mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 15:46:43 +00:00
core: return early if scheduled fork's timestamp can't be retrieved
This commit is contained in:
parent
62eda99668
commit
efbfd60222
2 changed files with 5 additions and 4 deletions
|
|
@ -2471,10 +2471,11 @@ func (bc *BlockChain) reportBlock(block *types.Block, res *ProcessResult, err er
|
|||
func (bc *BlockChain) logForkReadiness(block *types.Block) {
|
||||
c := bc.Config()
|
||||
current, last := c.LatestFork(block.Time()), c.LatestFork(math.MaxUint64)
|
||||
var at time.Time
|
||||
if t := c.Timestamp(last); t != nil {
|
||||
at = time.Unix(int64(*t), 0)
|
||||
t := c.Timestamp(last)
|
||||
if t == nil {
|
||||
return
|
||||
}
|
||||
at := time.Unix(int64(*t), 0)
|
||||
if current < last && time.Now().After(bc.lastForkReadyAlert.Add(forkReadyInterval)) {
|
||||
log.Info("Ready for fork activation", "fork", last, "date", at.Format(time.RFC822),
|
||||
"remaining", time.Until(at).Round(time.Second), "timestamp", at.Unix())
|
||||
|
|
|
|||
|
|
@ -888,7 +888,7 @@ func (c *ChainConfig) Timestamp(fork forks.Fork) *uint64 {
|
|||
case fork == forks.Shanghai:
|
||||
return c.ShanghaiTime
|
||||
default:
|
||||
panic("unknown timestamp fork requested")
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue