mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 18:30:45 +00:00
engine_v2: check minimum timestamp for the first v2 block, close XFN-16 (#1614)
This commit is contained in:
parent
956767a41e
commit
95f0bd2a4b
1 changed files with 1 additions and 1 deletions
|
|
@ -69,7 +69,7 @@ func (x *XDPoS_v2) verifyHeader(chain consensus.ChainReader, header *types.Heade
|
||||||
}
|
}
|
||||||
|
|
||||||
minePeriod := uint64(x.config.V2.Config(uint64(round)).MinePeriod)
|
minePeriod := uint64(x.config.V2.Config(uint64(round)).MinePeriod)
|
||||||
if parent.Number.Uint64() > x.config.V2.SwitchBlock.Uint64() && parent.Time+minePeriod > header.Time {
|
if parent.Number.Uint64() >= x.config.V2.SwitchBlock.Uint64() && parent.Time+minePeriod > header.Time {
|
||||||
log.Warn("[verifyHeader] Fail to verify header due to invalid timestamp", "ParentTime", parent.Time, "MinePeriod", minePeriod, "HeaderTime", header.Time, "Hash", header.Hash().Hex())
|
log.Warn("[verifyHeader] Fail to verify header due to invalid timestamp", "ParentTime", parent.Time, "MinePeriod", minePeriod, "HeaderTime", header.Time, "Hash", header.Hash().Hex())
|
||||||
return utils.ErrInvalidTimestamp
|
return utils.ErrInvalidTimestamp
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue