From ee7cf563233154602ef4bc76c79c4b67c457fedf Mon Sep 17 00:00:00 2001 From: Gary Rong Date: Wed, 28 Feb 2024 20:28:57 +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 abfc940750..e95152743e 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(dest common.Hash) bool { +func (db *Database) Recoverable(target common.Hash) bool { // Ensure the requested state is a known state. - dest = types.TrieRootHash(dest) - id := rawdb.ReadStateID(db.diskdb, dest) + target = types.TrieRootHash(target) + id := rawdb.ReadStateID(db.diskdb, target) if id == nil { return false } @@ -401,13 +401,13 @@ func (db *Database) Recoverable(dest 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 != dest { + if m.parent != target { return errors.New("unexpected state history") } if len(m.incomplete) > 0 { return errors.New("incomplete state history") } - dest = m.root + target = m.root return nil }) == nil }