Explorar o código

core/state/snapshot: don't create storage list for non-existing accounts

Péter Szilágyi %!s(int64=5) %!d(string=hai) anos
pai
achega
90af6dae6e
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      core/state/snapshot/difflayer.go

+ 5 - 0
core/state/snapshot/difflayer.go

@@ -526,6 +526,11 @@ func (dl *diffLayer) StorageList(accountHash common.Hash) ([]common.Hash, bool)
 	// If an old list already exists, return it
 	dl.lock.RLock()
 	_, destructed := dl.destructSet[accountHash]
+	if _, ok := dl.storageData[accountHash]; !ok {
+		// Account not tracked by this layer
+		dl.lock.RUnlock()
+		return nil, destructed
+	}
 	if list, exist := dl.storageList[accountHash]; exist {
 		dl.lock.RUnlock()
 		return list, destructed // The list might be nil