From efa7059ac3941961583f2c12f374b118571da4e1 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Mon, 9 Jan 2017 19:09:45 -0800 Subject: [PATCH] cmd/lncli: add support for new "Perm" field in connectpeer command --- cmd/lncli/commands.go | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/cmd/lncli/commands.go b/cmd/lncli/commands.go index bcff144c..3020fb78 100644 --- a/cmd/lncli/commands.go +++ b/cmd/lncli/commands.go @@ -133,8 +133,16 @@ func sendMany(ctx *cli.Context) error { } var ConnectCommand = cli.Command{ - Name: "connect", - Usage: "connect to a remote lnd peer: @host", + Name: "connect", + Usage: "connect to a remote lnd peer: @host (--perm=true|false])", + Flags: []cli.Flag{ + cli.BoolFlag{ + Name: "perm", + Usage: "If true, then the daemon will attempt to persistently " + + "connect to the target peer. If false then the call " + + "will be synchronous.", + }, + }, Action: connectPeer, } @@ -153,7 +161,10 @@ func connectPeer(ctx *cli.Context) error { Pubkey: splitAddr[0], Host: splitAddr[1], } - req := &lnrpc.ConnectPeerRequest{addr} + req := &lnrpc.ConnectPeerRequest{ + Addr: addr, + Perm: ctx.Bool("perm"), + } lnid, err := client.ConnectPeer(ctxb, req) if err != nil {