@@ -3,6 +3,8 @@ package main
33import (
44 "context"
55 "fmt"
6+ "strconv"
7+ "strings"
68 "time"
79
810 "github.com/btcsuite/btcutil"
@@ -25,10 +27,10 @@ var loopOutCommand = cli.Command{
2527 Optionally a BASE58/bech32 encoded bitcoin destination address may be
2628 specified. If not specified, a new wallet address will be generated.` ,
2729 Flags : []cli.Flag {
28- cli.Uint64Flag {
30+ cli.StringFlag {
2931 Name : "channel" ,
30- Usage : "the 8-byte compact channel ID of the channel " +
31- "to loop out" ,
32+ Usage : "the comma-separated list of short " +
33+ "channel IDs of the channels to loop out" ,
3234 },
3335 cli.StringFlag {
3436 Name : "addr" ,
@@ -87,6 +89,17 @@ func loopOut(ctx *cli.Context) error {
8789 return err
8890 }
8991
92+ // Parse outgoing channel set.
93+ chanStrings := strings .Split (ctx .String ("channel" ), "," )
94+ var outgoingChanSet []uint64
95+ for _ , chanString := range chanStrings {
96+ chanID , err := strconv .ParseUint (chanString , 10 , 64 )
97+ if err != nil {
98+ return err
99+ }
100+ outgoingChanSet = append (outgoingChanSet , chanID )
101+ }
102+
90103 var destAddr string
91104 switch {
92105 case ctx .IsSet ("addr" ):
@@ -145,11 +158,6 @@ func loopOut(ctx *cli.Context) error {
145158 return err
146159 }
147160
148- var unchargeChannel uint64
149- if ctx .IsSet ("channel" ) {
150- unchargeChannel = ctx .Uint64 ("channel" )
151- }
152-
153161 resp , err := client .LoopOut (context .Background (), & looprpc.LoopOutRequest {
154162 Amt : int64 (amt ),
155163 Dest : destAddr ,
@@ -158,7 +166,7 @@ func loopOut(ctx *cli.Context) error {
158166 MaxSwapFee : int64 (limits .maxSwapFee ),
159167 MaxPrepayRoutingFee : int64 (* limits .maxPrepayRoutingFee ),
160168 MaxSwapRoutingFee : int64 (* limits .maxSwapRoutingFee ),
161- LoopOutChannel : unchargeChannel ,
169+ OutgoingChanSet : outgoingChanSet ,
162170 SweepConfTarget : sweepConfTarget ,
163171 SwapPublicationDeadline : uint64 (swapDeadline .Unix ()),
164172 })
0 commit comments