mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +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
|
return errInvalidUncleHash
|
||||||
}
|
}
|
||||||
// Verify the timestamp
|
// Verify the timestamp
|
||||||
if header.Time <= parent.Time {
|
if header.Time < parent.Time {
|
||||||
return errInvalidTimestamp
|
return errInvalidTimestamp
|
||||||
}
|
}
|
||||||
// Verify the block's difficulty to ensure it's the default constant
|
// 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 {
|
if parent == nil {
|
||||||
return api.delayPayloadImport(block), 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())
|
log.Warn("Invalid timestamp", "parent", block.Time(), "block", block.Time())
|
||||||
return api.invalid(errors.New("invalid timestamp"), parent.Header()), nil
|
return api.invalid(errors.New("invalid timestamp"), parent.Header()), nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue