Merge pull request #2277 from Leozhang404/master

if no sectors need to recovery, checkNextRecoveries will return
This commit is contained in:
Łukasz Magiera 2020-07-06 19:24:15 +02:00 committed by GitHub
commit cf6ac44b6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -151,6 +151,17 @@ func (s *WindowPoStScheduler) checkNextRecoveries(ctx context.Context, deadline
return xerrors.Errorf("checking unrecovered sectors: %w", err)
}
// if all sectors failed to recover, don't declare recoveries
sbfCount, err := sbf.Count()
if err != nil {
return xerrors.Errorf("counting recovered sectors: %w", err)
}
if sbfCount == 0 {
log.Warnw("No recoveries to declare", "deadline", deadline, "faulty", uc)
return nil
}
params := &miner.DeclareFaultsRecoveredParams{
Recoveries: []miner.RecoveryDeclaration{{Deadline: deadline, Sectors: sbf}},
}