2
0
mirror of https://github.com/lightninglabs/loop synced 2024-11-04 06:00:21 +00:00

cmd/loop: add new key word argument for optional destination sweep address

This commit is contained in:
Olaoluwa Osuntokun 2019-03-20 17:29:42 -07:00
parent f089ff3484
commit b744afaa6f
No known key found for this signature in database
GPG Key ID: CE58F7F8E20FD9A2

View File

@ -25,6 +25,12 @@ var loopOutCommand = cli.Command{
Name: "channel",
Usage: "the 8-byte compact channel ID of the channel to loop out",
},
cli.StringFlag{
Name: "addr",
Usage: "the optional address that the looped out funds " +
"should be sent to, if let blank the funds " +
"will go to lnd's wallet",
},
},
Action: loopOut,
}
@ -44,8 +50,10 @@ func loopOut(ctx *cli.Context) error {
}
var destAddr string
args = args.Tail()
if args.Present() {
switch {
case ctx.IsSet("addr"):
destAddr = ctx.String("addr")
case args.Present():
destAddr = args.First()
}