mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 10:50:44 +00:00
triedb/pathdb: remove unused database entry
This commit is contained in:
parent
58256271de
commit
1cc112f121
2 changed files with 1 additions and 11 deletions
|
|
@ -439,12 +439,8 @@ func (db *Database) AdoptSyncedState(root common.Hash) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tell the snapshot subsystem the flat state is good by writing the new root
|
// Tell the snapshot subsystem the flat state is good by writing the new root
|
||||||
// and a "done" marker (nil journal) so the next boot doesn't try to
|
// and a "done" marker (nil journal) so the next boot doesn't try to rebuild it.
|
||||||
// rebuild it. Also clear any leftover recovery or disabled flags from a
|
|
||||||
// previous run.
|
|
||||||
batch := db.diskdb.NewBatch()
|
batch := db.diskdb.NewBatch()
|
||||||
rawdb.DeleteSnapshotRecoveryNumber(batch)
|
|
||||||
rawdb.DeleteSnapshotDisabled(batch)
|
|
||||||
rawdb.WriteSnapshotRoot(batch, root)
|
rawdb.WriteSnapshotRoot(batch, root)
|
||||||
journalProgress(batch, nil, nil)
|
journalProgress(batch, nil, nil)
|
||||||
if err := batch.Write(); err != nil {
|
if err := batch.Write(); err != nil {
|
||||||
|
|
|
||||||
|
|
@ -798,12 +798,6 @@ func TestAdoptSyncedState(t *testing.T) {
|
||||||
t.Fatalf("Generator marker should be empty, got %x", entry.Marker)
|
t.Fatalf("Generator marker should be empty, got %x", entry.Marker)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if rawdb.ReadSnapshotRecoveryNumber(tester.db.diskdb) != nil {
|
|
||||||
t.Fatal("Recovery flag should be cleared")
|
|
||||||
}
|
|
||||||
if rawdb.ReadSnapshotDisabled(tester.db.diskdb) {
|
|
||||||
t.Fatal("Disabled flag should be cleared")
|
|
||||||
}
|
|
||||||
if rawdb.ReadSnapSyncStatusFlag(tester.db.diskdb) != rawdb.StateSyncFinished {
|
if rawdb.ReadSnapSyncStatusFlag(tester.db.diskdb) != rawdb.StateSyncFinished {
|
||||||
t.Fatal("Sync-status flag should be StateSyncFinished")
|
t.Fatal("Sync-status flag should be StateSyncFinished")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue