diff --git a/cmd/lncli/commands.go b/cmd/lncli/commands.go index e618692a..78a7a99d 100644 --- a/cmd/lncli/commands.go +++ b/cmd/lncli/commands.go @@ -1385,9 +1385,21 @@ var listChannelsCommand = cli.Command{ Usage: "List all open channels", Flags: []cli.Flag{ cli.BoolFlag{ - Name: "active_only, a", + Name: "active_only", Usage: "only list channels which are currently active", }, + cli.BoolFlag{ + Name: "inactive_only", + Usage: "only list channels which are currently inactive", + }, + cli.BoolFlag{ + Name: "public_only", + Usage: "only list channels which are currently public", + }, + cli.BoolFlag{ + Name: "private_only", + Usage: "only list channels which are currently private", + }, }, Action: actionDecorator(listChannels), } @@ -1397,7 +1409,13 @@ func listChannels(ctx *cli.Context) error { client, cleanUp := getClient(ctx) defer cleanUp() - req := &lnrpc.ListChannelsRequest{} + req := &lnrpc.ListChannelsRequest{ + ActiveOnly: ctx.Bool("active_only"), + InactiveOnly: ctx.Bool("inactive_only"), + PublicOnly: ctx.Bool("public_only"), + PrivateOnly: ctx.Bool("private_only"), + } + resp, err := client.ListChannels(ctxb, req) if err != nil { return err