Skip to content

Commit 434cfe3

Browse files
committed
core/rawdb, triedb/pathdb: remove unnecessary journal deletion
1 parent 92bd4de commit 434cfe3

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

core/rawdb/accessors_state.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,6 @@ func WriteTrieJournal(db ethdb.KeyValueWriter, journal []byte) {
157157
}
158158
}
159159

160-
// DeleteTrieJournal deletes the serialized in-memory trie nodes of layers saved at
161-
// the last shutdown.
162-
func DeleteTrieJournal(db ethdb.KeyValueWriter) {
163-
if err := db.Delete(trieJournalKey); err != nil {
164-
log.Crit("Failed to remove tries journal", "err", err)
165-
}
166-
}
167-
168160
// ReadStateHistoryMeta retrieves the metadata corresponding to the specified
169161
// state history. Compute the position of state history in freezer by minus
170162
// one since the id of first state history starts from one(zero for initial

triedb/pathdb/database.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,6 @@ func (db *Database) Enable(root common.Hash) error {
498498
// Drop the stale state journal in persistent database and
499499
// reset the persistent state id back to zero.
500500
batch := db.diskdb.NewBatch()
501-
rawdb.DeleteTrieJournal(batch)
502501
rawdb.DeleteSnapshotRoot(batch)
503502
rawdb.WritePersistentStateID(batch, 0)
504503
if err := batch.Write(); err != nil {
@@ -568,8 +567,6 @@ func (db *Database) Recover(root common.Hash) error {
568567
// disk layer won't be accessible from outside.
569568
db.tree.init(dl)
570569
}
571-
rawdb.DeleteTrieJournal(db.diskdb)
572-
573570
// Explicitly sync the key-value store to ensure all recent writes are
574571
// flushed to disk. This step is crucial to prevent a scenario where
575572
// recent key-value writes are lost due to an application panic, while

0 commit comments

Comments
 (0)