mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-16 13:06:40 +00:00
triedb/pathdb: improve err message in historical state reader (#32477)
Fixes https://github.com/ethereum/go-ethereum/issues/32474
This commit is contained in:
parent
10421edf3e
commit
ac1731907d
1 changed files with 4 additions and 4 deletions
|
|
@ -207,11 +207,11 @@ type HistoricalStateReader struct {
|
||||||
// HistoricReader constructs a reader for accessing the requested historic state.
|
// HistoricReader constructs a reader for accessing the requested historic state.
|
||||||
func (db *Database) HistoricReader(root common.Hash) (*HistoricalStateReader, error) {
|
func (db *Database) HistoricReader(root common.Hash) (*HistoricalStateReader, error) {
|
||||||
// Bail out if the state history hasn't been fully indexed
|
// Bail out if the state history hasn't been fully indexed
|
||||||
if db.indexer == nil || !db.indexer.inited() {
|
if db.indexer == nil || db.freezer == nil {
|
||||||
return nil, errors.New("state histories haven't been fully indexed yet")
|
return nil, fmt.Errorf("historical state %x is not available", root)
|
||||||
}
|
}
|
||||||
if db.freezer == nil {
|
if !db.indexer.inited() {
|
||||||
return nil, errors.New("state histories are not available")
|
return nil, errors.New("state histories haven't been fully indexed yet")
|
||||||
}
|
}
|
||||||
// States at the current disk layer or above are directly accessible via
|
// States at the current disk layer or above are directly accessible via
|
||||||
// db.StateReader.
|
// db.StateReader.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue