Skip to content

Commit 894b1e3

Browse files
authored
Merge pull request #54 from binance-chain/fixLess
[R4R]les: fix GetProofsV2 bug (#21896)
2 parents f6ec491 + e0205f5 commit 894b1e3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

les/server_handler.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ func (h *serverHandler) handleMsg(p *clientPeer, wg *sync.WaitGroup) error {
582582
var (
583583
lastBHash common.Hash
584584
root common.Hash
585+
header *types.Header
585586
)
586587
reqCnt := len(req.Reqs)
587588
if accept(req.ReqID, uint64(reqCnt), MaxProofsFetch) {
@@ -596,10 +597,6 @@ func (h *serverHandler) handleMsg(p *clientPeer, wg *sync.WaitGroup) error {
596597
return
597598
}
598599
// Look up the root hash belonging to the request
599-
var (
600-
header *types.Header
601-
trie state.Trie
602-
)
603600
if request.BHash != lastBHash {
604601
root, lastBHash = common.Hash{}, request.BHash
605602

@@ -626,6 +623,7 @@ func (h *serverHandler) handleMsg(p *clientPeer, wg *sync.WaitGroup) error {
626623
// Open the account or storage trie for the request
627624
statedb := h.blockchain.StateCache()
628625

626+
var trie state.Trie
629627
switch len(request.AccKey) {
630628
case 0:
631629
// No account key specified, open an account trie

0 commit comments

Comments
 (0)