From 3675b8545dfe41b9d095c126454f7653c1b4fa3e Mon Sep 17 00:00:00 2001
From: Martin Holst Swende <martin@swende.se>
Date: Wed, 12 Jun 2019 10:57:00 +0200
Subject: les/handler: avoid lookup missing state

---
 les/handler.go | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'les')

diff --git a/les/handler.go b/les/handler.go
index 32f1903d1..4e98e0b32 100644
--- a/les/handler.go
+++ b/les/handler.go
@@ -868,6 +868,10 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
 						}
 						root = header.Root
 					}
+					// If a header lookup failed (non existent), ignore subsequent requests for the same header
+					if root == (common.Hash{}) {
+						continue
+					}
 					// Open the account or storage trie for the request
 					statedb := pm.blockchain.StateCache()
 
-- 
cgit v1.2.3