diff --git a/cli/state.go b/cli/state.go index a9e74f970..b0260f02b 100644 --- a/cli/state.go +++ b/cli/state.go @@ -281,17 +281,26 @@ var StatePowerCmd = &cli.Command{ ctx := ReqContext(cctx) + ts, err := LoadTipSet(ctx, cctx, api) + if err != nil { + return err + } + var maddr address.Address if cctx.Args().Present() { maddr, err = address.NewFromString(cctx.Args().First()) if err != nil { return err } - } - ts, err := LoadTipSet(ctx, cctx, api) - if err != nil { - return err + ma, err := api.StateGetActor(ctx, maddr, ts.Key()) + if err != nil { + return err + } + + if !builtin.IsStorageMinerActor(ma.Code) { + return xerrors.New("provided address does not correspond to a miner actor") + } } power, err := api.StateMinerPower(ctx, maddr, ts.Key())