Skip to content

Commit

Permalink
les: fix les/1 CHT compatibility issue (ethereum#15692)
Browse files Browse the repository at this point in the history
  • Loading branch information
zsfelfoldi authored and mariameda committed Aug 19, 2018
1 parent 14b260f commit 59f60cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions les/handler.go
Expand Up @@ -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)
Expand Down

0 comments on commit 59f60cd

Please sign in to comment.