aboutsummaryrefslogtreecommitdiffstats
path: root/light/lightchain.go
diff options
context:
space:
mode:
authorJanos Guljas <janos@resenje.org>2018-09-25 22:57:31 +0800
committerJanos Guljas <janos@resenje.org>2018-09-25 22:57:31 +0800
commit24349144b6c0642755569268bab56b9033743212 (patch)
tree9d9d2b6659fd8a56512dfc807aafe4b733165ae1 /light/lightchain.go
parent7d56602391e155e2ce9ba7c261300a1804ab9972 (diff)
parentd3441ebb563439bac0837d70591f92e2c6080303 (diff)
downloadgo-tangerine-24349144b6c0642755569268bab56b9033743212.tar
go-tangerine-24349144b6c0642755569268bab56b9033743212.tar.gz
go-tangerine-24349144b6c0642755569268bab56b9033743212.tar.bz2
go-tangerine-24349144b6c0642755569268bab56b9033743212.tar.lz
go-tangerine-24349144b6c0642755569268bab56b9033743212.tar.xz
go-tangerine-24349144b6c0642755569268bab56b9033743212.tar.zst
go-tangerine-24349144b6c0642755569268bab56b9033743212.zip
Merge branch 'master' into max-stream-peer-servers
Diffstat (limited to 'light/lightchain.go')
-rw-r--r--light/lightchain.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/light/lightchain.go b/light/lightchain.go
index d40a4ee6c..8e2734c2d 100644
--- a/light/lightchain.go
+++ b/light/lightchain.go
@@ -118,19 +118,19 @@ func NewLightChain(odr OdrBackend, config *params.ChainConfig, engine consensus.
}
// addTrustedCheckpoint adds a trusted checkpoint to the blockchain
-func (self *LightChain) addTrustedCheckpoint(cp TrustedCheckpoint) {
+func (self *LightChain) addTrustedCheckpoint(cp *params.TrustedCheckpoint) {
if self.odr.ChtIndexer() != nil {
- StoreChtRoot(self.chainDb, cp.SectionIdx, cp.SectionHead, cp.CHTRoot)
- self.odr.ChtIndexer().AddCheckpoint(cp.SectionIdx, cp.SectionHead)
+ StoreChtRoot(self.chainDb, cp.SectionIndex, cp.SectionHead, cp.CHTRoot)
+ self.odr.ChtIndexer().AddCheckpoint(cp.SectionIndex, cp.SectionHead)
}
if self.odr.BloomTrieIndexer() != nil {
- StoreBloomTrieRoot(self.chainDb, cp.SectionIdx, cp.SectionHead, cp.BloomRoot)
- self.odr.BloomTrieIndexer().AddCheckpoint(cp.SectionIdx, cp.SectionHead)
+ StoreBloomTrieRoot(self.chainDb, cp.SectionIndex, cp.SectionHead, cp.BloomRoot)
+ self.odr.BloomTrieIndexer().AddCheckpoint(cp.SectionIndex, cp.SectionHead)
}
if self.odr.BloomIndexer() != nil {
- self.odr.BloomIndexer().AddCheckpoint(cp.SectionIdx, cp.SectionHead)
+ self.odr.BloomIndexer().AddCheckpoint(cp.SectionIndex, cp.SectionHead)
}
- log.Info("Added trusted checkpoint", "chain", cp.name, "block", (cp.SectionIdx+1)*self.indexerConfig.ChtSize-1, "hash", cp.SectionHead)
+ log.Info("Added trusted checkpoint", "chain", cp.Name, "block", (cp.SectionIndex+1)*self.indexerConfig.ChtSize-1, "hash", cp.SectionHead)
}
func (self *LightChain) getProcInterrupt() bool {
@@ -157,7 +157,7 @@ func (self *LightChain) loadLastState() error {
// Issue a status log and return
header := self.hc.CurrentHeader()
headerTd := self.GetTd(header.Hash(), header.Number.Uint64())
- log.Info("Loaded most recent local header", "number", header.Number, "hash", header.Hash(), "td", headerTd)
+ log.Info("Loaded most recent local header", "number", header.Number, "hash", header.Hash(), "td", headerTd, "age", common.PrettyAge(time.Unix(header.Time.Int64(), 0)))
return nil
}
@@ -488,7 +488,7 @@ func (self *LightChain) SyncCht(ctx context.Context) bool {
// Ensure the chain didn't move past the latest block while retrieving it
if self.hc.CurrentHeader().Number.Uint64() < header.Number.Uint64() {
- log.Info("Updated latest header based on CHT", "number", header.Number, "hash", header.Hash())
+ log.Info("Updated latest header based on CHT", "number", header.Number, "hash", header.Hash(), "age", common.PrettyAge(time.Unix(header.Time.Int64(), 0)))
self.hc.SetCurrentHeader(header)
}
return true