Skip to content

Commit

Permalink
re-enable snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
gballet authored and jsign committed Jul 3, 2023
1 parent ad2fdb4 commit 8c6f9bf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,17 @@ func New(root common.Hash, db Database, snaps *snapshot.Tree) (*StateDB, error)
sdb.snapDestructs = make(map[common.Hash]struct{})
sdb.snapAccounts = make(map[common.Hash][]byte)
sdb.snapStorage = make(map[common.Hash]map[common.Hash][]byte)
} else {
if fdb, ok := db.(*ForkingDB); ok {
trans := fdb.getTranslation(root)
if trans != (common.Hash{}) {
if sdb.snap = sdb.snaps.Snapshot(trans); sdb.snap != nil {
sdb.snapDestructs = make(map[common.Hash]struct{})
sdb.snapAccounts = make(map[common.Hash][]byte)
sdb.snapStorage = make(map[common.Hash]map[common.Hash][]byte)
}
}
}
}
}
return sdb, nil
Expand Down

0 comments on commit 8c6f9bf

Please sign in to comment.