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 {