aboutsummaryrefslogtreecommitdiffstats
path: root/light
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2019-04-17 20:47:54 +0800
committerGitHub <noreply@github.com>2019-04-17 20:47:54 +0800
commit4bcc0a37ab70cb79b16893556cffdaad6974e7d8 (patch)
tree13a20867c5df35d41655991195e92bd1e5c25de0 /light
parentcdae1c59abc32f85debfa29577fbf1ed036ebf73 (diff)
parentb5f92e66c6df3594430ced80334d0217ddb9ec34 (diff)
downloadgo-tangerine-1.8.27.tar
go-tangerine-1.8.27.tar.gz
go-tangerine-1.8.27.tar.bz2
go-tangerine-1.8.27.tar.lz
go-tangerine-1.8.27.tar.xz
go-tangerine-1.8.27.tar.zst
go-tangerine-1.8.27.zip
Merge pull request #19473 from karalabe/geth-1.8.27v1.8.27
[1.8.27 backport] 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")