core/rawdb: fix read error

pull/29792/head
Gary Rong 6 months ago
parent 65baef9e0e
commit e6ba338d50
  1. 6
      core/rawdb/freezer_table.go

@ -400,8 +400,8 @@ func (t *freezerTable) repairIndex() error {
} }
size := stat.Size() size := stat.Size()
// Move the read cursor to the beginning of the file. // Move the read cursor to the beginning of the file
_, err = t.index.Seek(0, 0) _, err = t.index.Seek(0, io.SeekStart)
if err != nil { if err != nil {
return err return err
} }
@ -414,7 +414,7 @@ func (t *freezerTable) repairIndex() error {
head indexEntry head indexEntry
read = func() (indexEntry, error) { read = func() (indexEntry, error) {
n, err := fr.Read(buff) n, err := io.ReadFull(fr, buff)
if err != nil { if err != nil {
return indexEntry{}, err return indexEntry{}, err
} }

Loading…
Cancel
Save