apply suggestions

This commit is contained in:
LexLuthr 2024-04-19 16:37:42 +04:00 committed by Łukasz Magiera
parent 72fac27a4d
commit 103a7e0697

View File

@ -372,13 +372,12 @@ func (b *CommitBatcher) processBatchV2(cfg sealiface.Config, sectors []abi.Secto
collateral = big.Add(collateral, sc) collateral = big.Add(collateral, sc)
manifest := b.todo[sector].ActivationManifest manifest := b.todo[sector].ActivationManifest
if len(manifest.Pieces) > 0 {
precomitInfo, err := b.api.StateSectorPreCommitInfo(b.mctx, b.maddr, sector, ts.Key()) precomitInfo, err := b.api.StateSectorPreCommitInfo(b.mctx, b.maddr, sector, ts.Key())
if err != nil { if err != nil {
res.FailedSectors[sector] = err.Error() res.FailedSectors[sector] = err.Error()
continue continue
} }
if len(manifest.Pieces) > 0 {
err = b.allocationCheck(manifest.Pieces, precomitInfo, abi.ActorID(mid), ts) err = b.allocationCheck(manifest.Pieces, precomitInfo, abi.ActorID(mid), ts)
if err != nil { if err != nil {
res.FailedSectors[sector] = err.Error() res.FailedSectors[sector] = err.Error()
@ -927,7 +926,7 @@ func (b *CommitBatcher) aggregateProofType(nv network.Version) (abi.RegisteredAg
func (b *CommitBatcher) allocationCheck(Pieces []miner.PieceActivationManifest, precomitInfo *miner.SectorPreCommitOnChainInfo, miner abi.ActorID, ts *types.TipSet) error { func (b *CommitBatcher) allocationCheck(Pieces []miner.PieceActivationManifest, precomitInfo *miner.SectorPreCommitOnChainInfo, miner abi.ActorID, ts *types.TipSet) error {
for _, p := range Pieces { for _, p := range Pieces {
p := p p := p
// skip filler pieces // skip pieces not claiming an allocation
if p.VerifiedAllocationKey == nil { if p.VerifiedAllocationKey == nil {
continue continue
} }