Skip to content

Commit d9957d0

Browse files
committed
Fix getting oldAccount before deleting it
1 parent 3da037b commit d9957d0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/state/snapshot/snapshot.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -565,12 +565,13 @@ func diffToDisk(bottom *diffLayer) *diskLayer {
565565
continue
566566
}
567567

568+
oldAccount, err := base.account(hash, true)
569+
568570
// Delete the account snapshot
569571
rawdb.DeleteAccountSnapshot(batch, hash)
570572
base.cache.Set(hash[:], nil)
571573

572574
// Try to check if there's any associated storage to delete from the snapshot
573-
oldAccount, err := base.account(hash, true)
574575
if err != nil {
575576
log.Warn("Failed to get destructed account from snapshot", "err", err)
576577
// Fall through to deleting storage in case this account has any

0 commit comments

Comments
 (0)