storageminer: Call beginPosting before trying to commit a sector

This commit is contained in:
Łukasz Magiera 2019-10-29 22:58:41 +01:00
parent 3047c9d4c2
commit b7a78670ab

View File

@ -213,10 +213,6 @@ func (m *Miner) commitSector(ctx context.Context, sinfo sectorbuilder.SectorSeal
return errors.Wrap(err, "pushing message to mpool")
}
if err := m.commt.TrackCommitSectorMsg(m.maddr, sinfo.SectorID, smsg.Cid()); err != nil {
return errors.Wrap(err, "tracking sector commitment")
}
go func() {
_, err := m.api.StateWaitMsg(ctx, smsg.Cid())
if err != nil {
@ -226,6 +222,10 @@ func (m *Miner) commitSector(ctx context.Context, sinfo sectorbuilder.SectorSeal
m.beginPosting(ctx)
}()
if err := m.commt.TrackCommitSectorMsg(m.maddr, sinfo.SectorID, smsg.Cid()); err != nil {
return xerrors.Errorf("tracking sector commitment: %w", err)
}
return nil
}