Skip to content

Commit 59f60cd

Browse files
zsfelfoldimariameda
authored andcommitted
les: fix les/1 CHT compatibility issue (ethereum#15692)
1 parent 14b260f commit 59f60cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

les/handler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -846,8 +846,8 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
846846
}
847847

848848
if header := pm.blockchain.GetHeaderByNumber(req.BlockNum); header != nil {
849-
sectionHead := core.GetCanonicalHash(pm.chainDb, (req.ChtNum+1)*light.ChtV1Frequency-1)
850-
if root := light.GetChtRoot(pm.chainDb, req.ChtNum, sectionHead); root != (common.Hash{}) {
849+
sectionHead := core.GetCanonicalHash(pm.chainDb, req.ChtNum*light.ChtV1Frequency-1)
850+
if root := light.GetChtRoot(pm.chainDb, req.ChtNum-1, sectionHead); root != (common.Hash{}) {
851851
if tr, _ := trie.New(root, trieDb); tr != nil {
852852
var encNumber [8]byte
853853
binary.BigEndian.PutUint64(encNumber[:], req.BlockNum)

0 commit comments

Comments
 (0)