diff options
author | Péter Szilágyi <peterke@gmail.com> | 2018-02-11 20:57:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-11 20:57:46 +0800 |
commit | 7a0019c63b1297cb5c9a6fdfc4cb00fdae9b05aa (patch) | |
tree | 98bc8333d5672cd4faa6a13c9a59f902c277955f /les/peer.go | |
parent | 5cf75a30c1ceb0ab35cd6b0532520d556996b21c (diff) | |
download | dexon-7a0019c63b1297cb5c9a6fdfc4cb00fdae9b05aa.tar dexon-7a0019c63b1297cb5c9a6fdfc4cb00fdae9b05aa.tar.gz dexon-7a0019c63b1297cb5c9a6fdfc4cb00fdae9b05aa.tar.bz2 dexon-7a0019c63b1297cb5c9a6fdfc4cb00fdae9b05aa.tar.lz dexon-7a0019c63b1297cb5c9a6fdfc4cb00fdae9b05aa.tar.xz dexon-7a0019c63b1297cb5c9a6fdfc4cb00fdae9b05aa.tar.zst dexon-7a0019c63b1297cb5c9a6fdfc4cb00fdae9b05aa.zip |
les, light: fix CHT trie retrievals (#16039)
* les, light: fix CHT trie retrievals
* les, light: minor polishes, test remote CHT retrievals
* les, light: deterministic nodeset rlp, bloombits test skeleton
* les: add an event emission to the les bloombits test
* les: drop dead tester code
Diffstat (limited to 'les/peer.go')
-rw-r--r-- | les/peer.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/les/peer.go b/les/peer.go index b72c80d35..caf568077 100644 --- a/les/peer.go +++ b/les/peer.go @@ -281,7 +281,6 @@ func (p *peer) RequestProofs(reqID, cost uint64, reqs []ProofReq) error { default: panic(nil) } - } // RequestHelperTrieProofs fetches a batch of HelperTrie merkle proofs from a remote node. @@ -291,12 +290,12 @@ func (p *peer) RequestHelperTrieProofs(reqID, cost uint64, reqs []HelperTrieReq) case lpv1: reqsV1 := make([]ChtReq, len(reqs)) for i, req := range reqs { - if req.HelperTrieType != htCanonical || req.AuxReq != auxHeader || len(req.Key) != 8 { + if req.Type != htCanonical || req.AuxReq != auxHeader || len(req.Key) != 8 { return fmt.Errorf("Request invalid in LES/1 mode") } blockNum := binary.BigEndian.Uint64(req.Key) // convert HelperTrie request to old CHT request - reqsV1[i] = ChtReq{ChtNum: (req.TrieIdx + 1) * (light.ChtFrequency / light.ChtV1Frequency), BlockNum: blockNum, FromLevel: req.FromLevel} + reqsV1[i] = ChtReq{ChtNum: (req.TrieIdx + 1) * (light.CHTFrequencyClient / light.CHTFrequencyServer), BlockNum: blockNum, FromLevel: req.FromLevel} } return sendRequest(p.rw, GetHeaderProofsMsg, reqID, cost, reqsV1) case lpv2: |