allow nil segment (#5224)

* Alpha modification

* save

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
This commit is contained in:
Alex Sharov 2022-08-30 11:01:26 +07:00 committed by GitHub
parent 01dbad0979
commit c898c2a242
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 4 deletions

View File

@ -31,10 +31,10 @@ var (
// see https://calver.org // see https://calver.org
const ( const (
VersionMajor = 2022 // Major version component of the current release VersionMajor = 2022 // Major version component of the current release
VersionMinor = 99 // Minor version component of the current release VersionMinor = 8 // Minor version component of the current release
VersionMicro = 99 // Patch version component of the current release VersionMicro = 3 // Patch version component of the current release
VersionModifier = "dev" // Modifier component of the current release VersionModifier = "alpha" // Modifier component of the current release
VersionKeyCreated = "ErigonVersionCreated" VersionKeyCreated = "ErigonVersionCreated"
VersionKeyFinished = "ErigonVersionFinished" VersionKeyFinished = "ErigonVersionFinished"
) )

View File

@ -412,6 +412,9 @@ func (s *RoSnapshots) Files() (list []string) {
defer s.Txs.lock.RUnlock() defer s.Txs.lock.RUnlock()
max := s.BlocksAvailable() max := s.BlocksAvailable()
for _, seg := range s.Bodies.segments { for _, seg := range s.Bodies.segments {
if seg.seg == nil {
continue
}
if seg.ranges.from > max { if seg.ranges.from > max {
continue continue
} }
@ -419,6 +422,9 @@ func (s *RoSnapshots) Files() (list []string) {
list = append(list, fName) list = append(list, fName)
} }
for _, seg := range s.Headers.segments { for _, seg := range s.Headers.segments {
if seg.seg == nil {
continue
}
if seg.ranges.from > max { if seg.ranges.from > max {
continue continue
} }
@ -426,6 +432,9 @@ func (s *RoSnapshots) Files() (list []string) {
list = append(list, fName) list = append(list, fName)
} }
for _, seg := range s.Txs.segments { for _, seg := range s.Txs.segments {
if seg.Seg == nil {
continue
}
if seg.ranges.from > max { if seg.ranges.from > max {
continue continue
} }