Merge pull request #711 from filecoin-project/fix/fallback-restarting

storageminer: Don't start fPoSt with every head change
This commit is contained in:
Łukasz Magiera 2019-12-03 23:30:02 +01:00 committed by GitHub
commit 281eacbc83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,10 +102,12 @@ func (s *fpostScheduler) update(ctx context.Context, new *types.TipSet) error {
return err
}
if newEPS != s.activeEPS {
s.abortActivePoSt()
if newEPS == s.activeEPS {
return nil
}
s.abortActivePoSt()
if newEPS != Inactive && start {
s.doPost(ctx, newEPS, new)
}
@ -124,7 +126,7 @@ func (s *fpostScheduler) abortActivePoSt() {
log.Warnf("Aborting Fallback PoSt (EPS: %d)", s.activeEPS)
s.activeEPS = 0
s.activeEPS = Inactive
s.abort = nil
}