From 56c0ee15174205bed0dec3d56ce7c593bba6b87f Mon Sep 17 00:00:00 2001 From: BurtonQin Date: Mon, 20 Apr 2020 09:58:17 -0400 Subject: [PATCH] Remove Unlock before panic --- core/state/snapshot/iterator.go | 1 - core/state/snapshot/snapshot.go | 1 - 2 files changed, 2 deletions(-) diff --git a/core/state/snapshot/iterator.go b/core/state/snapshot/iterator.go index 4c619d3ce8..e6a0cd9474 100644 --- a/core/state/snapshot/iterator.go +++ b/core/state/snapshot/iterator.go @@ -128,7 +128,6 @@ func (it *diffAccountIterator) Account() []byte { it.layer.lock.RUnlock() return nil } - it.layer.lock.RUnlock() panic(fmt.Sprintf("iterator referenced non-existent account: %x", it.curHash)) } it.layer.lock.RUnlock() diff --git a/core/state/snapshot/snapshot.go b/core/state/snapshot/snapshot.go index 35cc8da432..27a8c7f0bb 100644 --- a/core/state/snapshot/snapshot.go +++ b/core/state/snapshot/snapshot.go @@ -420,7 +420,6 @@ func diffToDisk(bottom *diffLayer) *diskLayer { // Mark the original base as stale as we're going to create a new wrapper base.lock.Lock() if base.stale { - base.lock.Unlock() panic("parent disk layer is stale") // we've committed into the same base from two children, boo } base.stale = true