mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-29 19:22:40 +01:00
cmd/lncli: add support for new "Perm" field in connectpeer command
This commit is contained in:
parent
8cdb84c619
commit
efa7059ac3
@ -133,8 +133,16 @@ func sendMany(ctx *cli.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var ConnectCommand = cli.Command{
|
var ConnectCommand = cli.Command{
|
||||||
Name: "connect",
|
Name: "connect",
|
||||||
Usage: "connect to a remote lnd peer: <pubkey>@host",
|
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,
|
Action: connectPeer,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,7 +161,10 @@ func connectPeer(ctx *cli.Context) error {
|
|||||||
Pubkey: splitAddr[0],
|
Pubkey: splitAddr[0],
|
||||||
Host: splitAddr[1],
|
Host: splitAddr[1],
|
||||||
}
|
}
|
||||||
req := &lnrpc.ConnectPeerRequest{addr}
|
req := &lnrpc.ConnectPeerRequest{
|
||||||
|
Addr: addr,
|
||||||
|
Perm: ctx.Bool("perm"),
|
||||||
|
}
|
||||||
|
|
||||||
lnid, err := client.ConnectPeer(ctxb, req)
|
lnid, err := client.ConnectPeer(ctxb, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user