aboutsummaryrefslogtreecommitdiffstats
path: root/les/handler.go
diff options
context:
space:
mode:
authorFelföldi Zsolt <zsfelfoldi@gmail.com>2018-01-09 18:41:59 +0800
committerFelix Lange <fjl@users.noreply.github.com>2018-01-09 18:41:59 +0800
commit83d16574444d0b389755c9003e74a90d2ab7ca2e (patch)
treebdf066c42799014dd50bfa71d62c2dd85423b66a /les/handler.go
parent9d06026c1991fdd8f034ce194fa20a0740c21810 (diff)
downloaddexon-83d16574444d0b389755c9003e74a90d2ab7ca2e.tar
dexon-83d16574444d0b389755c9003e74a90d2ab7ca2e.tar.gz
dexon-83d16574444d0b389755c9003e74a90d2ab7ca2e.tar.bz2
dexon-83d16574444d0b389755c9003e74a90d2ab7ca2e.tar.lz
dexon-83d16574444d0b389755c9003e74a90d2ab7ca2e.tar.xz
dexon-83d16574444d0b389755c9003e74a90d2ab7ca2e.tar.zst
dexon-83d16574444d0b389755c9003e74a90d2ab7ca2e.zip
les: fix les/1 CHT compatibility issue (#15692)
Diffstat (limited to 'les/handler.go')
-rw-r--r--les/handler.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/les/handler.go b/les/handler.go
index e310942ba..d627c3e18 100644
--- a/les/handler.go
+++ b/les/handler.go
@@ -846,8 +846,8 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
}
if header := pm.blockchain.GetHeaderByNumber(req.BlockNum); header != nil {
- sectionHead := core.GetCanonicalHash(pm.chainDb, (req.ChtNum+1)*light.ChtV1Frequency-1)
- if root := light.GetChtRoot(pm.chainDb, req.ChtNum, sectionHead); root != (common.Hash{}) {
+ sectionHead := core.GetCanonicalHash(pm.chainDb, req.ChtNum*light.ChtV1Frequency-1)
+ if root := light.GetChtRoot(pm.chainDb, req.ChtNum-1, sectionHead); root != (common.Hash{}) {
if tr, _ := trie.New(root, trieDb); tr != nil {
var encNumber [8]byte
binary.BigEndian.PutUint64(encNumber[:], req.BlockNum)