aboutsummaryrefslogtreecommitdiffstats
path: root/les/handler.go
diff options
context:
space:
mode:
Diffstat (limited to 'les/handler.go')
-rw-r--r--les/handler.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/les/handler.go b/les/handler.go
index 2fb2067dd..718a2ed68 100644
--- a/les/handler.go
+++ b/les/handler.go
@@ -153,9 +153,12 @@ func NewProtocolManager(chainConfig *params.ChainConfig, indexerConfig *light.In
if disableClientRemovePeer {
removePeer = func(id string) {}
}
-
if lightSync {
- manager.downloader = downloader.New(downloader.LightSync, chainDb, manager.eventMux, nil, blockchain, removePeer)
+ var checkpoint uint64
+ if cht, ok := params.TrustedCheckpoints[blockchain.Genesis().Hash()]; ok {
+ checkpoint = (cht.SectionIndex+1)*params.CHTFrequencyClient - 1
+ }
+ manager.downloader = downloader.New(downloader.LightSync, checkpoint, chainDb, manager.eventMux, nil, blockchain, removePeer)
manager.peers.notify((*downloaderPeerNotify)(manager))
manager.fetcher = newLightFetcher(manager)
}