Skip to content

Commit bddd103

Browse files
authored
les: fix GetProofsV2 bug (#21896)
1 parent 6b58409 commit bddd103

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

les/server_handler.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,7 @@ func (h *serverHandler) handleMsg(p *clientPeer, wg *sync.WaitGroup) error {
610610
var (
611611
lastBHash common.Hash
612612
root common.Hash
613+
header *types.Header
613614
)
614615
reqCnt := len(req.Reqs)
615616
if accept(req.ReqID, uint64(reqCnt), MaxProofsFetch) {
@@ -624,10 +625,6 @@ func (h *serverHandler) handleMsg(p *clientPeer, wg *sync.WaitGroup) error {
624625
return
625626
}
626627
// Look up the root hash belonging to the request
627-
var (
628-
header *types.Header
629-
trie state.Trie
630-
)
631628
if request.BHash != lastBHash {
632629
root, lastBHash = common.Hash{}, request.BHash
633630

@@ -654,6 +651,7 @@ func (h *serverHandler) handleMsg(p *clientPeer, wg *sync.WaitGroup) error {
654651
// Open the account or storage trie for the request
655652
statedb := h.blockchain.StateCache()
656653

654+
var trie state.Trie
657655
switch len(request.AccKey) {
658656
case 0:
659657
// No account key specified, open an account trie

0 commit comments

Comments
 (0)