diff options
author | Péter Szilágyi <peterke@gmail.com> | 2018-09-10 21:21:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-10 21:21:21 +0800 |
commit | 10bac3664702f31228eafedecf31e9bf115f6c29 (patch) | |
tree | 726d54c8bd785f7411639de13ef59e25bac2a5e4 /consensus/clique/clique.go | |
parent | 0e32989a08b8b84e7fe4ae397fe4302e93e34782 (diff) | |
parent | bcfb7f58b93e6fb5f3da0000672adee80fd6a485 (diff) | |
download | dexon-10bac3664702f31228eafedecf31e9bf115f6c29.tar dexon-10bac3664702f31228eafedecf31e9bf115f6c29.tar.gz dexon-10bac3664702f31228eafedecf31e9bf115f6c29.tar.bz2 dexon-10bac3664702f31228eafedecf31e9bf115f6c29.tar.lz dexon-10bac3664702f31228eafedecf31e9bf115f6c29.tar.xz dexon-10bac3664702f31228eafedecf31e9bf115f6c29.tar.zst dexon-10bac3664702f31228eafedecf31e9bf115f6c29.zip |
Merge pull request #17620 from karalabe/clique-epoch-fix
consensus/clique: only trust snapshot for genesis or les checkpoint
Diffstat (limited to 'consensus/clique/clique.go')
-rw-r--r-- | consensus/clique/clique.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index 547290984..0ff72e55c 100644 --- a/consensus/clique/clique.go +++ b/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() |