mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 06:06:44 +00:00
fixes
This commit is contained in:
parent
4bdf29612d
commit
477bbf1d18
2 changed files with 15 additions and 1 deletions
|
|
@ -380,3 +380,17 @@ func (f *chainFreezer) Ancient(kind string, number uint64) ([]byte, error) {
|
|||
}
|
||||
return nil, errUnknownTable
|
||||
}
|
||||
|
||||
// AncientRange retrieves multiple items in sequence, starting from the index 'start'.
|
||||
// It will return
|
||||
// - at most 'count' items,
|
||||
// - if maxBytes is specified: at least 1 item (even if exceeding the maxByteSize),
|
||||
// but will otherwise return as many items as fit into maxByteSize.
|
||||
// - if maxBytes is not specified, 'count' items will be returned if they are present.
|
||||
func (f *chainFreezer) ReadAncients(fn func(ethdb.AncientReaderOp) error) (err error) {
|
||||
if store, ok := f.AncientStore.(*Freezer); ok {
|
||||
store.writeLock.Lock()
|
||||
defer store.writeLock.Unlock()
|
||||
}
|
||||
return fn(f)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ func (db *Store) openEraFile(epoch uint64) (*era.Era, error) {
|
|||
return nil, fmt.Errorf("multiple era1 files found for epoch %d", epoch)
|
||||
}
|
||||
if len(matches) == 0 {
|
||||
return nil, nil
|
||||
return nil, fs.ErrNotExist
|
||||
}
|
||||
filename := matches[0]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue