good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit 10bac366 authored by Péter Szilágyi's avatar Péter Szilágyi Committed by GitHub
Browse files

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

consensus/clique: only trust snapshot for genesis or les checkpoint
parents 0e32989a bcfb7f58
No related branches found
No related tags found
No related merge requests found
...@@ -388,7 +388,7 @@ func (c *Clique) snapshot(chain consensus.ChainReader, number uint64, hash commo ...@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment