@@ -10,6 +10,7 @@ import (
10
10
"github.com/btcsuite/btcutil"
11
11
"github.com/lightninglabs/loop"
12
12
"github.com/lightninglabs/loop/labels"
13
+ "github.com/lightninglabs/loop/loopdb"
13
14
"github.com/lightninglabs/loop/looprpc"
14
15
"github.com/urfave/cli"
15
16
)
@@ -42,6 +43,13 @@ var loopOutCommand = cli.Command{
42
43
Name : "amt" ,
43
44
Usage : "the amount in satoshis to loop out" ,
44
45
},
46
+ cli.Uint64Flag {
47
+ Name : "htlc_confs" ,
48
+ Usage : "the number of of confirmations, in blocks " +
49
+ "that we require for the htlc extended by " +
50
+ "the server before we reveal the preimage." ,
51
+ Value : uint64 (loopdb .DefaultLoopOutHtlcConfirmations ),
52
+ },
45
53
cli.Uint64Flag {
46
54
Name : "conf_target" ,
47
55
Usage : "the number of blocks from the swap " +
@@ -135,6 +143,11 @@ func loopOut(ctx *cli.Context) error {
135
143
}
136
144
137
145
sweepConfTarget := int32 (ctx .Uint64 ("conf_target" ))
146
+ htlcConfs := int32 (ctx .Uint64 ("htlc_confs" ))
147
+ if htlcConfs == 0 {
148
+ return fmt .Errorf ("at least 1 confirmation required for htlcs" )
149
+ }
150
+
138
151
quoteReq := & looprpc.QuoteRequest {
139
152
Amt : int64 (amt ),
140
153
ConfTarget : sweepConfTarget ,
@@ -179,6 +192,7 @@ func loopOut(ctx *cli.Context) error {
179
192
MaxSwapRoutingFee : int64 (limits .maxSwapRoutingFee ),
180
193
OutgoingChanSet : outgoingChanSet ,
181
194
SweepConfTarget : sweepConfTarget ,
195
+ HtlcConfirmations : htlcConfs ,
182
196
SwapPublicationDeadline : uint64 (swapDeadline .Unix ()),
183
197
Label : label ,
184
198
})
0 commit comments