diff --git a/core/blockchain.go b/core/blockchain.go index 8d64d5bc7a..4e1bf2b317 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -2820,7 +2820,7 @@ func (bc *BlockChain) StateSizer() *state.SizeTracker { return bc.stateSizer } -// FirstStateBlock returns the first available state block number that is stored in the database. -func (bc *BlockChain) FirstStateBlock() (uint64, error) { - return bc.triedb.FirstStateBlock() +// FrezzerTailBlock returns the block number of the oldest state in the freezer. +func (bc *BlockChain) FreezerTailBlock() (uint64, error) { + return bc.triedb.FreezerTailBlock() } diff --git a/triedb/database.go b/triedb/database.go index 2c12a8abce..62d66be2e8 100644 --- a/triedb/database.go +++ b/triedb/database.go @@ -385,12 +385,11 @@ func (db *Database) SnapshotCompleted() bool { return pdb.SnapshotCompleted() } -// FirstStateBlock returns the first available state block number that is stored in the database. -func (db *Database) FirstStateBlock() (uint64, error) { +// FrezzerTailBlock returns the block number of the oldest state in the freezer. +func (db *Database) FreezerTailBlock() (uint64, error) { pdb, ok := db.backend.(*pathdb.Database) if !ok { - // Ignore in hash scheme return 0, nil } - return pdb.FirstStateBlock() + return pdb.FrezzerTailBlock() } diff --git a/triedb/pathdb/database.go b/triedb/pathdb/database.go index 08cd6cc045..40fe19f566 100644 --- a/triedb/pathdb/database.go +++ b/triedb/pathdb/database.go @@ -693,8 +693,8 @@ func (db *Database) SnapshotCompleted() bool { return db.tree.bottom().genComplete() } -// FirstStateBlock returns the block number of the oldest state in the freezer. -func (db *Database) FirstStateBlock() (uint64, error) { +// FrezzerTailBlock returns the block number of the oldest state in the freezer. +func (db *Database) FrezzerTailBlock() (uint64, error) { freezer := db.stateFreezer if freezer == nil { return 0, errors.New("freezer is not available")