diff options
author | Péter Szilágyi <peterke@gmail.com> | 2019-04-16 18:20:38 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2019-04-17 19:56:58 +0800 |
commit | d8787230faa07e078a183765271313a7d2c6bdf2 (patch) | |
tree | d31d955dd0cc0b44a7ba5a9ee0097f8e148e0db5 /light | |
parent | cdae1c59abc32f85debfa29577fbf1ed036ebf73 (diff) | |
download | go-tangerine-d8787230faa07e078a183765271313a7d2c6bdf2.tar go-tangerine-d8787230faa07e078a183765271313a7d2c6bdf2.tar.gz go-tangerine-d8787230faa07e078a183765271313a7d2c6bdf2.tar.bz2 go-tangerine-d8787230faa07e078a183765271313a7d2c6bdf2.tar.lz go-tangerine-d8787230faa07e078a183765271313a7d2c6bdf2.tar.xz go-tangerine-d8787230faa07e078a183765271313a7d2c6bdf2.tar.zst go-tangerine-d8787230faa07e078a183765271313a7d2c6bdf2.zip |
eth, les, light: enforce CHT checkpoints on fast-sync too
Diffstat (limited to 'light')
-rw-r--r-- | light/lightchain.go | 2 | ||||
-rw-r--r-- | light/postprocess.go | 8 |
2 files changed, 1 insertions, 9 deletions
diff --git a/light/lightchain.go b/light/lightchain.go index 977f497a7..c9143c05f 100644 --- a/light/lightchain.go +++ b/light/lightchain.go @@ -100,7 +100,7 @@ func NewLightChain(odr OdrBackend, config *params.ChainConfig, engine consensus. if bc.genesisBlock == nil { return nil, core.ErrNoGenesis } - if cp, ok := trustedCheckpoints[bc.genesisBlock.Hash()]; ok { + if cp, ok := params.TrustedCheckpoints[bc.genesisBlock.Hash()]; ok { bc.addTrustedCheckpoint(cp) } if err := bc.loadLastState(); err != nil { diff --git a/light/postprocess.go b/light/postprocess.go index 24fe47bc7..8e0495566 100644 --- a/light/postprocess.go +++ b/light/postprocess.go @@ -104,14 +104,6 @@ var ( } ) -// trustedCheckpoints associates each known checkpoint with the genesis hash of the chain it belongs to -var trustedCheckpoints = map[common.Hash]*params.TrustedCheckpoint{ - params.MainnetGenesisHash: params.MainnetTrustedCheckpoint, - params.TestnetGenesisHash: params.TestnetTrustedCheckpoint, - params.RinkebyGenesisHash: params.RinkebyTrustedCheckpoint, - params.GoerliGenesisHash: params.GoerliTrustedCheckpoint, -} - var ( ErrNoTrustedCht = errors.New("no trusted canonical hash trie") ErrNoTrustedBloomTrie = errors.New("no trusted bloom trie") |