From 98fcaa31db726567484660147e863443d33e7b7b Mon Sep 17 00:00:00 2001 From: Gary Rong Date: Wed, 28 Feb 2024 20:29:58 +0800 Subject: [PATCH] triedb/pathdb: rename --- triedb/pathdb/database.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/triedb/pathdb/database.go b/triedb/pathdb/database.go index e95152743e..307f307df5 100644 --- a/triedb/pathdb/database.go +++ b/triedb/pathdb/database.go @@ -377,10 +377,10 @@ func (db *Database) Recover(root common.Hash, loader triestate.TrieLoader) error } // Recoverable returns the indicator if the specified state is recoverable. -func (db *Database) Recoverable(target common.Hash) bool { +func (db *Database) Recoverable(root common.Hash) bool { // Ensure the requested state is a known state. - target = types.TrieRootHash(target) - id := rawdb.ReadStateID(db.diskdb, target) + root = types.TrieRootHash(root) + id := rawdb.ReadStateID(db.diskdb, root) if id == nil { return false } @@ -401,13 +401,13 @@ func (db *Database) Recoverable(target common.Hash) bool { // Ensure the requested state is a canonical state and all state // histories in range [id+1, disklayer.ID] are present and complete. return checkHistories(db.freezer, *id+1, dl.stateID()-*id, func(m *meta) error { - if m.parent != target { + if m.parent != root { return errors.New("unexpected state history") } if len(m.incomplete) > 0 { return errors.New("incomplete state history") } - target = m.root + root = m.root return nil }) == nil }