aboutsummaryrefslogtreecommitdiffstats
path: root/light
diff options
context:
space:
mode:
authorFelföldi Zsolt <zsfelfoldi@gmail.com>2018-08-28 15:31:34 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-08-28 15:31:34 +0800
commit63352bf4247f05d8ef255ff8c63290225c3bc671 (patch)
treebdaf3c271cc59445bdea27480701e8d2a19be440 /light
parentb69476b372a26679e5bdb33db3d508f2c955e7ff (diff)
downloadgo-tangerine-63352bf4247f05d8ef255ff8c63290225c3bc671.tar
go-tangerine-63352bf4247f05d8ef255ff8c63290225c3bc671.tar.gz
go-tangerine-63352bf4247f05d8ef255ff8c63290225c3bc671.tar.bz2
go-tangerine-63352bf4247f05d8ef255ff8c63290225c3bc671.tar.lz
go-tangerine-63352bf4247f05d8ef255ff8c63290225c3bc671.tar.xz
go-tangerine-63352bf4247f05d8ef255ff8c63290225c3bc671.tar.zst
go-tangerine-63352bf4247f05d8ef255ff8c63290225c3bc671.zip
core: safe indexer operation when syncing starts before the checkpoint (#17511)
Diffstat (limited to 'light')
-rw-r--r--light/lightchain.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/light/lightchain.go b/light/lightchain.go
index bd798eca2..d40a4ee6c 100644
--- a/light/lightchain.go
+++ b/light/lightchain.go
@@ -121,14 +121,14 @@ func NewLightChain(odr OdrBackend, config *params.ChainConfig, engine consensus.
func (self *LightChain) addTrustedCheckpoint(cp TrustedCheckpoint) {
if self.odr.ChtIndexer() != nil {
StoreChtRoot(self.chainDb, cp.SectionIdx, cp.SectionHead, cp.CHTRoot)
- self.odr.ChtIndexer().AddKnownSectionHead(cp.SectionIdx, cp.SectionHead)
+ self.odr.ChtIndexer().AddCheckpoint(cp.SectionIdx, cp.SectionHead)
}
if self.odr.BloomTrieIndexer() != nil {
StoreBloomTrieRoot(self.chainDb, cp.SectionIdx, cp.SectionHead, cp.BloomRoot)
- self.odr.BloomTrieIndexer().AddKnownSectionHead(cp.SectionIdx, cp.SectionHead)
+ self.odr.BloomTrieIndexer().AddCheckpoint(cp.SectionIdx, cp.SectionHead)
}
if self.odr.BloomIndexer() != nil {
- self.odr.BloomIndexer().AddKnownSectionHead(cp.SectionIdx, cp.SectionHead)
+ self.odr.BloomIndexer().AddCheckpoint(cp.SectionIdx, cp.SectionHead)
}
log.Info("Added trusted checkpoint", "chain", cp.name, "block", (cp.SectionIdx+1)*self.indexerConfig.ChtSize-1, "hash", cp.SectionHead)
}