Skip to content

Commit

Permalink
snapshot: add Unlock before return (ethereum#20948)
Browse files Browse the repository at this point in the history
* Forget Unlock in snapshot

* Remove Unlock before panic
  • Loading branch information
BurtonQin committed Apr 21, 2020
1 parent 79b68dd commit 7599999
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/state/snapshot/iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 7599999

Please sign in to comment.