Skip to content

Commit

Permalink
Add --include_unannounced flag to describegraph lncli command.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Bluetegu committed Sep 27, 2018
1 parent ced86ab commit 519a410
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions cmd/lncli/commands.go
Expand Up @@ -2467,15 +2467,26 @@ 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 include both private channels, and public " +
"channels whose authentication proof were not confirmed yet, " +
"hence were not announced.",
},
},
Action: actionDecorator(describeGraph),
}

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 {
Expand Down

0 comments on commit 519a410

Please sign in to comment.