Skip to content

Commit

Permalink
remove calls to miner service
Browse files Browse the repository at this point in the history
  • Loading branch information
nonsense committed Jul 29, 2021
1 parent 595695a commit 7a29872
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions cmd/lotus-miner/market.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ var setAskCmd = &cli.Command{
Usage: "Set maximum piece size (w/bit-padding, in bytes) in ask to `SIZE`",
DefaultText: "miner sector size",
},
&cli.StringFlag{
Name: "sector-size",
Usage: "",
Required: true,
},
},
Action: func(cctx *cli.Context) error {
ctx := lcli.DaemonContext(cctx)
Expand Down Expand Up @@ -252,18 +257,11 @@ var setAskCmd = &cli.Command{
return xerrors.Errorf("cannot parse max-piece-size to quantity of bytes: %w", err)
}

maddr, err := api.ActorAddress(ctx)
if err != nil {
return err
}

ssize, err := api.ActorSectorSize(ctx, maddr)
smax, err := units.RAMInBytes(cctx.String("sector-size"))
if err != nil {
return err
}

smax := int64(ssize)

if max == 0 {
max = smax
}
Expand Down

0 comments on commit 7a29872

Please sign in to comment.