mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 21:17:16 +00:00
Snapshots: corner cases when .seg exists and .idx doesn't (#3731)
This commit is contained in:
parent
b73415fb3f
commit
a04fa4838d
@ -600,12 +600,17 @@ func BuildIndices(ctx context.Context, s *RoSnapshots, snapshotDir *dir.Rw, chai
|
||||
return err
|
||||
}
|
||||
if err := s.Txs.View(func(segments []*TxnSegment) error {
|
||||
for i, sn := range segments {
|
||||
if sn.From < from {
|
||||
continue
|
||||
}
|
||||
return s.Bodies.View(func(bodySegments []*BodySegment) error {
|
||||
for i, sn := range segments {
|
||||
if sn.From < from {
|
||||
continue
|
||||
}
|
||||
|
||||
if bodySegments[i].idxBodyNumber == nil {
|
||||
log.Info("[snapshots] Segment has no index, skip", "seg", bodySegments[i].seg.FilePath())
|
||||
continue
|
||||
}
|
||||
|
||||
if err := s.Bodies.View(func(bodySegments []*BodySegment) error {
|
||||
// build txs idx
|
||||
gg := bodySegments[i].seg.MakeGetter()
|
||||
buf, _ := gg.Next(nil)
|
||||
@ -633,13 +638,9 @@ func BuildIndices(ctx context.Context, s *RoSnapshots, snapshotDir *dir.Rw, chai
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}); err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
}
|
||||
return nil
|
||||
return nil
|
||||
})
|
||||
}); err != nil {
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user