Skip to content

Commit

Permalink
Use old check of snapshot genMarker
Browse files Browse the repository at this point in the history
  • Loading branch information
PlasmaPower committed Jan 23, 2025
1 parent c1fb64d commit 3da037b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/state/snapshot/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,14 +560,17 @@ func diffToDisk(bottom *diffLayer) *diskLayer {

// Destroy all the destructed accounts from the database
for hash := range bottom.destructSet {
oldAccount, err := base.account(hash, true)
// Skip any account not covered yet by the snapshot
if errors.Is(err, ErrNotCoveredYet) {
if base.genMarker != nil && bytes.Compare(hash[:], base.genMarker) > 0 {
continue
}

// Delete the account snapshot
rawdb.DeleteAccountSnapshot(batch, hash)
base.cache.Set(hash[:], nil)

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

0 comments on commit 3da037b

Please sign in to comment.