Skip to content

Commit 3da037b

Browse files
committed
Use old check of snapshot genMarker
1 parent c1fb64d commit 3da037b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

core/state/snapshot/snapshot.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,14 +560,17 @@ func diffToDisk(bottom *diffLayer) *diskLayer {
560560

561561
// Destroy all the destructed accounts from the database
562562
for hash := range bottom.destructSet {
563-
oldAccount, err := base.account(hash, true)
564563
// Skip any account not covered yet by the snapshot
565-
if errors.Is(err, ErrNotCoveredYet) {
564+
if base.genMarker != nil && bytes.Compare(hash[:], base.genMarker) > 0 {
566565
continue
567566
}
567+
568+
// Delete the account snapshot
568569
rawdb.DeleteAccountSnapshot(batch, hash)
569570
base.cache.Set(hash[:], nil)
570571

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

0 commit comments

Comments
 (0)