cmd/lncli: add support for new "Perm" field in connectpeer command

This commit is contained in:
Olaoluwa Osuntokun 2017-01-09 19:09:45 -08:00
parent 8cdb84c619
commit efa7059ac3
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2

@ -133,8 +133,16 @@ func sendMany(ctx *cli.Context) error {
}
var ConnectCommand = cli.Command{
Name: "connect",
Usage: "connect to a remote lnd peer: <pubkey>@host",
Name: "connect",
Usage: "connect to a remote lnd peer: <pubkey>@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 {