Skip to content

Commit b744afa

Browse files
committed
cmd/loop: add new key word argument for optional destination sweep address
1 parent f089ff3 commit b744afa

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

cmd/loop/loopout.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ var loopOutCommand = cli.Command{
2525
Name: "channel",
2626
Usage: "the 8-byte compact channel ID of the channel to loop out",
2727
},
28+
cli.StringFlag{
29+
Name: "addr",
30+
Usage: "the optional address that the looped out funds " +
31+
"should be sent to, if let blank the funds " +
32+
"will go to lnd's wallet",
33+
},
2834
},
2935
Action: loopOut,
3036
}
@@ -44,8 +50,10 @@ func loopOut(ctx *cli.Context) error {
4450
}
4551

4652
var destAddr string
47-
args = args.Tail()
48-
if args.Present() {
53+
switch {
54+
case ctx.IsSet("addr"):
55+
destAddr = ctx.String("addr")
56+
case args.Present():
4957
destAddr = args.First()
5058
}
5159

0 commit comments

Comments
 (0)