Merge pull request #17620 from karalabe/clique-epoch-fix

consensus/clique: only trust snapshot for genesis or les checkpoint
pull/17561/merge
Péter Szilágyi 6 years ago committed by GitHub
commit 10bac36647
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      consensus/clique/clique.go

@ -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 number%c.config.Epoch == 0 {
if number == 0 || (number%c.config.Epoch == 0 && chain.GetHeaderByNumber(number-1) == nil) {
checkpoint := chain.GetHeaderByNumber(number)
if checkpoint != nil {
hash := checkpoint.Hash()

Loading…
Cancel
Save