mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 14:16:44 +00:00
core/rawdb, triedb/pathdb: remove unnecessary journal deletion
This commit is contained in:
parent
92bd4de5cf
commit
434cfe3a2c
2 changed files with 0 additions and 11 deletions
|
|
@ -157,14 +157,6 @@ func WriteTrieJournal(db ethdb.KeyValueWriter, journal []byte) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteTrieJournal deletes the serialized in-memory trie nodes of layers saved at
|
|
||||||
// the last shutdown.
|
|
||||||
func DeleteTrieJournal(db ethdb.KeyValueWriter) {
|
|
||||||
if err := db.Delete(trieJournalKey); err != nil {
|
|
||||||
log.Crit("Failed to remove tries journal", "err", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ReadStateHistoryMeta retrieves the metadata corresponding to the specified
|
// ReadStateHistoryMeta retrieves the metadata corresponding to the specified
|
||||||
// state history. Compute the position of state history in freezer by minus
|
// state history. Compute the position of state history in freezer by minus
|
||||||
// one since the id of first state history starts from one(zero for initial
|
// one since the id of first state history starts from one(zero for initial
|
||||||
|
|
|
||||||
|
|
@ -498,7 +498,6 @@ func (db *Database) Enable(root common.Hash) error {
|
||||||
// Drop the stale state journal in persistent database and
|
// Drop the stale state journal in persistent database and
|
||||||
// reset the persistent state id back to zero.
|
// reset the persistent state id back to zero.
|
||||||
batch := db.diskdb.NewBatch()
|
batch := db.diskdb.NewBatch()
|
||||||
rawdb.DeleteTrieJournal(batch)
|
|
||||||
rawdb.DeleteSnapshotRoot(batch)
|
rawdb.DeleteSnapshotRoot(batch)
|
||||||
rawdb.WritePersistentStateID(batch, 0)
|
rawdb.WritePersistentStateID(batch, 0)
|
||||||
if err := batch.Write(); err != nil {
|
if err := batch.Write(); err != nil {
|
||||||
|
|
@ -568,8 +567,6 @@ func (db *Database) Recover(root common.Hash) error {
|
||||||
// disk layer won't be accessible from outside.
|
// disk layer won't be accessible from outside.
|
||||||
db.tree.init(dl)
|
db.tree.init(dl)
|
||||||
}
|
}
|
||||||
rawdb.DeleteTrieJournal(db.diskdb)
|
|
||||||
|
|
||||||
// Explicitly sync the key-value store to ensure all recent writes are
|
// Explicitly sync the key-value store to ensure all recent writes are
|
||||||
// flushed to disk. This step is crucial to prevent a scenario where
|
// flushed to disk. This step is crucial to prevent a scenario where
|
||||||
// recent key-value writes are lost due to an application panic, while
|
// recent key-value writes are lost due to an application panic, while
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue