snapshot: add Unlock before return (#20948)

* Forget Unlock in snapshot

* Remove Unlock before panic
pull/20952/head
Boqin Qin 5 years ago committed by GitHub
parent 79b68dd78d
commit 7599999dcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      core/state/snapshot/iterator.go

@ -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))

Loading…
Cancel
Save