From 90af6dae6efc934e698bac11b09f773724e296bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Wed, 6 May 2020 17:22:38 +0300 Subject: [PATCH] core/state/snapshot: don't create storage list for non-existing accounts --- core/state/snapshot/difflayer.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/state/snapshot/difflayer.go b/core/state/snapshot/difflayer.go index 00a2f32064..ad4bb4fcb4 100644 --- a/core/state/snapshot/difflayer.go +++ b/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