Skip to content

Commit bcfb7f5

Browse files
committed
consensus/clique: only trust snapshot for genesis or les checkpoint
1 parent ae992a5 commit bcfb7f5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎consensus/clique/clique.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ func (c *Clique) snapshot(chain consensus.ChainReader, number uint64, hash commo
388388
}
389389
}
390390
// If we're at an checkpoint block, make a snapshot if it's known
391-
if number%c.config.Epoch == 0 {
391+
if number == 0 || (number%c.config.Epoch == 0 && chain.GetHeaderByNumber(number-1) == nil) {
392392
checkpoint := chain.GetHeaderByNumber(number)
393393
if checkpoint != nil {
394394
hash := checkpoint.Hash()

0 commit comments

Comments
 (0)