From 85944c25619da8cfb69dd78ec191b219ca720f3f Mon Sep 17 00:00:00 2001 From: gary rong Date: Thu, 7 May 2020 15:07:59 +0800 Subject: [PATCH] core/state/snapshot: fix typo (#21037) --- core/state/snapshot/difflayer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/state/snapshot/difflayer.go b/core/state/snapshot/difflayer.go index ad4bb4fcb4..fc8f534b4b 100644 --- a/core/state/snapshot/difflayer.go +++ b/core/state/snapshot/difflayer.go @@ -523,7 +523,6 @@ func (dl *diffLayer) AccountList() []common.Hash { // // Note, the returned slice is not a copy, so do not modify it. 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 { @@ -531,9 +530,10 @@ func (dl *diffLayer) StorageList(accountHash common.Hash) ([]common.Hash, bool) dl.lock.RUnlock() return nil, destructed } + // If an old list already exists, return it if list, exist := dl.storageList[accountHash]; exist { dl.lock.RUnlock() - return list, destructed // The list might be nil + return list, destructed // the cached list can't be nil } dl.lock.RUnlock()