aboutsummaryrefslogtreecommitdiffstats
path: root/les/commons.go
diff options
context:
space:
mode:
authorZsolt Felfoldi <zsfelfoldi@gmail.com>2019-04-05 23:40:03 +0800
committerZsolt Felfoldi <zsfelfoldi@gmail.com>2019-04-08 19:17:24 +0800
commit64f9c1ea0984141623843abfa9262fc9401192f2 (patch)
tree72b6e966a4705446bf2a05ad84ba84786aef3009 /les/commons.go
parent5515f364ae1673c1bf5569c089b5853c90ea1655 (diff)
downloadgo-tangerine-64f9c1ea0984141623843abfa9262fc9401192f2.tar
go-tangerine-64f9c1ea0984141623843abfa9262fc9401192f2.tar.gz
go-tangerine-64f9c1ea0984141623843abfa9262fc9401192f2.tar.bz2
go-tangerine-64f9c1ea0984141623843abfa9262fc9401192f2.tar.lz
go-tangerine-64f9c1ea0984141623843abfa9262fc9401192f2.tar.xz
go-tangerine-64f9c1ea0984141623843abfa9262fc9401192f2.tar.zst
go-tangerine-64f9c1ea0984141623843abfa9262fc9401192f2.zip
les, light: remove support for les/1 4096 block CHT sections
Diffstat (limited to 'les/commons.go')
-rw-r--r--les/commons.go14
1 files changed, 1 insertions, 13 deletions
diff --git a/les/commons.go b/les/commons.go
index 21fb25714..32fd65449 100644
--- a/les/commons.go
+++ b/les/commons.go
@@ -80,28 +80,16 @@ func (c *lesCommons) nodeInfo() interface{} {
sections, _, _ := c.chtIndexer.Sections()
sections2, _, _ := c.bloomTrieIndexer.Sections()
- if !c.protocolManager.lightSync {
- // convert to client section size if running in server mode
- sections /= c.iConfig.PairChtSize / c.iConfig.ChtSize
- }
-
if sections2 < sections {
sections = sections2
}
if sections > 0 {
sectionIndex := sections - 1
sectionHead := c.bloomTrieIndexer.SectionHead(sectionIndex)
- var chtRoot common.Hash
- if c.protocolManager.lightSync {
- chtRoot = light.GetChtRoot(c.chainDb, sectionIndex, sectionHead)
- } else {
- idxV2 := (sectionIndex+1)*c.iConfig.PairChtSize/c.iConfig.ChtSize - 1
- chtRoot = light.GetChtRoot(c.chainDb, idxV2, sectionHead)
- }
cht = params.TrustedCheckpoint{
SectionIndex: sectionIndex,
SectionHead: sectionHead,
- CHTRoot: chtRoot,
+ CHTRoot: light.GetChtRoot(c.chainDb, sectionIndex, sectionHead),
BloomRoot: light.GetBloomTrieRoot(c.chainDb, sectionIndex, sectionHead),
}
}