Merge pull request #1727 from filecoin-project/fix/init-sector-size
properly handle parsing of miner init sector sizes
This commit is contained in:
commit
d009b70171
@ -25,7 +25,7 @@ func DefaultSectorSize() abi.SectorSize {
|
||||
}
|
||||
|
||||
sort.Slice(szs, func(i, j int) bool {
|
||||
return szs[i] < szs[i]
|
||||
return szs[i] < szs[j]
|
||||
})
|
||||
|
||||
return szs[0]
|
||||
|
@ -79,7 +79,7 @@ var initCmd = &cli.Command{
|
||||
&cli.StringFlag{
|
||||
Name: "sector-size",
|
||||
Usage: "specify sector size to use",
|
||||
Value: fmt.Sprint(build.DefaultSectorSize()),
|
||||
Value: units.BytesSize(float64(build.DefaultSectorSize())),
|
||||
},
|
||||
&cli.StringSliceFlag{
|
||||
Name: "pre-sealed-sectors",
|
||||
@ -603,7 +603,10 @@ func createStorageMiner(ctx context.Context, api lapi.FullNode, peerid peer.ID,
|
||||
return address.Undef, err
|
||||
}
|
||||
|
||||
ssize := cctx.Uint64("sector-size")
|
||||
ssize, err := units.RAMInBytes(cctx.String("sector-size"))
|
||||
if err != nil {
|
||||
return address.Undef, fmt.Errorf("failed to parse sector size: %w", err)
|
||||
}
|
||||
|
||||
worker := owner
|
||||
if cctx.String("worker") != "" {
|
||||
|
Loading…
Reference in New Issue
Block a user