diff --git a/turbo/snapshotsync/freezeblocks/block_snapshots.go b/turbo/snapshotsync/freezeblocks/block_snapshots.go index 2fa5987a51f..b67638e97d6 100644 --- a/turbo/snapshotsync/freezeblocks/block_snapshots.go +++ b/turbo/snapshotsync/freezeblocks/block_snapshots.go @@ -757,11 +757,16 @@ func (s *RoSnapshots) integrityCheck(fName string) bool { func integrityCheck(dir, fName string) bool { file := filepath.Join(dir, fName) f, err := os.Stat(file) - if os.IsNotExist(err) { + if err != nil { + log.Warn("[snapshots] integrityCheck", "err", err) return false } torrentFile := filepath.Join(dir, fName) + ".torrent" - if _, err := os.Stat(torrentFile); os.IsNotExist(err) { + _, err = os.Stat(torrentFile) + if err != nil { + if !os.IsNotExist(err) { + log.Warn("[snapshots] integrityCheck", "err", err) + } // torrent file not exists means that file is created locally, in this case file must be complete return true } @@ -769,7 +774,10 @@ func integrityCheck(dir, fName string) bool { fName = strings.ReplaceAll(fName, ".idx", ".txt") commitmentFile := filepath.Join(dir, "commitment", fName) cf, err := os.Stat(commitmentFile) - if os.IsNotExist(err) { + if err != nil { + if !os.IsNotExist(err) { + log.Warn("[snapshots] integrityCheck", "err", err) + } return false } if cf.ModTime().After(f.ModTime()) {