Merge pull request #10611 from filecoin-project/fix/check-sector-exists
fix: cli: Check if the sectorID exists before removing
This commit is contained in:
commit
43941876f4
@ -1392,6 +1392,12 @@ var sectorsRemoveCmd = &cli.Command{
|
|||||||
return xerrors.Errorf("could not parse sector number: %w", err)
|
return xerrors.Errorf("could not parse sector number: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if the sector exists
|
||||||
|
_, err = minerAPI.SectorsStatus(ctx, abi.SectorNumber(id), false)
|
||||||
|
if err != nil {
|
||||||
|
return xerrors.Errorf("sectorID %d has not been created yet: %w", id, err)
|
||||||
|
}
|
||||||
|
|
||||||
return minerAPI.SectorRemove(ctx, abi.SectorNumber(id))
|
return minerAPI.SectorRemove(ctx, abi.SectorNumber(id))
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user