aboutsummaryrefslogtreecommitdiffstats
path: root/light
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2019-04-16 18:20:38 +0800
committerPéter Szilágyi <peterke@gmail.com>2019-04-17 19:56:58 +0800
commitd8787230faa07e078a183765271313a7d2c6bdf2 (patch)
treed31d955dd0cc0b44a7ba5a9ee0097f8e148e0db5 /light
parentcdae1c59abc32f85debfa29577fbf1ed036ebf73 (diff)
downloadgo-tangerine-d8787230faa07e078a183765271313a7d2c6bdf2.tar.gz
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.go2
-rw-r--r--light/postprocess.go8
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")