Skip to content

Commit

Permalink
les: fix panic (#20013)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjl493456442 authored and holiman committed Aug 27, 2019
1 parent 6850259 commit 396f1dd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions les/server_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -583,15 +583,14 @@ func (h *serverHandler) handleMsg(p *peer, wg *sync.WaitGroup) error {
}
// Look up the root hash belonging to the request
var (
number *uint64
header *types.Header
trie state.Trie
)
if request.BHash != lastBHash {
root, lastBHash = common.Hash{}, request.BHash

if header = h.blockchain.GetHeaderByHash(request.BHash); header == nil {
p.Log().Warn("Failed to retrieve header for proof", "block", *number, "hash", request.BHash)
p.Log().Warn("Failed to retrieve header for proof", "hash", request.BHash)
atomic.AddUint32(&p.invalidCount, 1)
continue
}
Expand Down

0 comments on commit 396f1dd

Please sign in to comment.