triedb: Snapshot completed

Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
jsvisa 2025-08-06 14:32:32 +08:00 committed by Gary Rong
parent 2f90e8a3da
commit 485d1b136f
2 changed files with 14 additions and 0 deletions

View file

@ -375,3 +375,12 @@ func (db *Database) IsVerkle() bool {
func (db *Database) Disk() ethdb.Database { func (db *Database) Disk() ethdb.Database {
return db.disk return db.disk
} }
// SnapshotCompleted returns the indicator if the snapshot is completed.
func (db *Database) SnapshotCompleted() bool {
pdb, ok := db.backend.(*pathdb.Database)
if !ok {
return false
}
return pdb.SnapshotCompleted()
}

View file

@ -681,3 +681,8 @@ func (db *Database) StorageIterator(root common.Hash, account common.Hash, seek
} }
return newFastStorageIterator(db, root, account, seek) return newFastStorageIterator(db, root, account, seek)
} }
// SnapshotCompleted returns the indicator if the snapshot generation is completed.
func (db *Database) SnapshotCompleted() bool {
return !db.waitSync && db.tree.bottom().genComplete()
}