Explorar o código

les/handler: avoid lookup missing state

Martin Holst Swende %!s(int64=6) %!d(string=hai) anos
pai
achega
3675b8545d
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      les/handler.go

+ 4 - 0
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()