mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-05 15:52:55 +00:00
consensus/clique: only trust snapshot for genesis or les checkpoint
This commit is contained in:
parent
ae992a5d73
commit
bcfb7f58b9
1 changed files with 1 additions and 1 deletions
|
|
@ -388,7 +388,7 @@ func (c *Clique) snapshot(chain consensus.ChainReader, number uint64, hash commo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If we're at an checkpoint block, make a snapshot if it's known
|
// If we're at an checkpoint block, make a snapshot if it's known
|
||||||
if number%c.config.Epoch == 0 {
|
if number == 0 || (number%c.config.Epoch == 0 && chain.GetHeaderByNumber(number-1) == nil) {
|
||||||
checkpoint := chain.GetHeaderByNumber(number)
|
checkpoint := chain.GetHeaderByNumber(number)
|
||||||
if checkpoint != nil {
|
if checkpoint != nil {
|
||||||
hash := checkpoint.Hash()
|
hash := checkpoint.Hash()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue