snapshot: add Unlock before return (#20948)

* Forget Unlock in snapshot

* Remove Unlock before panic
This commit is contained in:
Boqin Qin
2020-04-21 16:11:38 +08:00
committed by GitHub
parent 79b68dd78d
commit 7599999dcd

View File

@ -125,6 +125,7 @@ func (it *diffAccountIterator) Account() []byte {
blob, ok := it.layer.accountData[it.curHash]
if !ok {
if _, ok := it.layer.destructSet[it.curHash]; ok {
it.layer.lock.RUnlock()
return nil
}
panic(fmt.Sprintf("iterator referenced non-existent account: %x", it.curHash))