mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 06:36:43 +00:00
fix block time verification
This commit is contained in:
parent
cce928eaaf
commit
7bc58427f5
2 changed files with 2 additions and 2 deletions
|
|
@ -233,7 +233,7 @@ func (beacon *Beacon) verifyHeader(chain consensus.ChainHeaderReader, header, pa
|
|||
return errInvalidUncleHash
|
||||
}
|
||||
// Verify the timestamp
|
||||
if header.Time <= parent.Time {
|
||||
if header.Time < parent.Time {
|
||||
return errInvalidTimestamp
|
||||
}
|
||||
// Verify the block's difficulty to ensure it's the default constant
|
||||
|
|
|
|||
|
|
@ -892,7 +892,7 @@ func (api *ConsensusAPI) newPayload(params engine.ExecutableData, versionedHashe
|
|||
if parent == nil {
|
||||
return api.delayPayloadImport(block), nil
|
||||
}
|
||||
if block.Time() <= parent.Time() {
|
||||
if block.Time() < parent.Time() {
|
||||
log.Warn("Invalid timestamp", "parent", block.Time(), "block", block.Time())
|
||||
return api.invalid(errors.New("invalid timestamp"), parent.Header()), nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue