From 2f3e2f930898fa715ff314aa5edd0a8e1f64b33d Mon Sep 17 00:00:00 2001 From: bluetegu Date: Thu, 27 Sep 2018 02:45:04 -0400 Subject: [PATCH] Add --include_unannounced flag to describegraph lncli command. Private and public channels which weren't announced yet are returned only if the flag is set. Note: this changes the default output of describegraph which used to return all channels known to node. --- cmd/lncli/commands.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cmd/lncli/commands.go b/cmd/lncli/commands.go index 30967dc9e..1fd7a1bf4 100644 --- a/cmd/lncli/commands.go +++ b/cmd/lncli/commands.go @@ -2467,7 +2467,15 @@ var describeGraphCommand = cli.Command{ Category: "Peers", Description: "Prints a human readable version of the known channel " + "graph from the PoV of the node", - Usage: "Describe the network graph.", + Usage: "Describe the network graph.", + Flags: []cli.Flag{ + cli.BoolFlag{ + Name: "include_unannounced", + Usage: "If set, unannounced channels will be included in the " + + "graph. Unannounced channels are both private channels, and " + + "public channels that are not yet announced to the network.", + }, + }, Action: actionDecorator(describeGraph), } @@ -2475,7 +2483,9 @@ func describeGraph(ctx *cli.Context) error { client, cleanUp := getClient(ctx) defer cleanUp() - req := &lnrpc.ChannelGraphRequest{} + req := &lnrpc.ChannelGraphRequest{ + IncludeUnannounced: ctx.Bool("include_unannounced"), + } graph, err := client.DescribeGraph(context.Background(), req) if err != nil {