File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package main
2
2
3
3
import (
4
4
"context"
5
+ "time"
5
6
6
7
"github.com/lightninglabs/loop/looprpc"
7
8
"github.com/urfave/cli"
@@ -20,6 +21,16 @@ var quoteCommand = cli.Command{
20
21
"should be swept within in a Loop Out" ,
21
22
Value : 6 ,
22
23
},
24
+ cli.BoolFlag {
25
+ Name : "fast" ,
26
+ Usage : "Indicate you want to swap immediately, " +
27
+ "paying potentially a higher fee. If not " +
28
+ "set the swap server might choose to wait up " +
29
+ "to 30 minutes before publishing the swap " +
30
+ "HTLC on-chain, to save on chain fees. Not " +
31
+ "setting this flag might result in a lower " +
32
+ "swap fee." ,
33
+ },
23
34
},
24
35
Action : quote ,
25
36
}
@@ -43,10 +54,17 @@ func quote(ctx *cli.Context) error {
43
54
}
44
55
defer cleanup ()
45
56
57
+ fast := ctx .Bool ("fast" )
58
+ swapDeadline := time .Now ()
59
+ if ! fast {
60
+ swapDeadline = time .Now ().Add (defaultSwapWaitTime )
61
+ }
62
+
46
63
ctxb := context .Background ()
47
64
resp , err := client .LoopOutQuote (ctxb , & looprpc.QuoteRequest {
48
- Amt : int64 (amt ),
49
- ConfTarget : int32 (ctx .Uint64 ("conf_target" )),
65
+ Amt : int64 (amt ),
66
+ ConfTarget : int32 (ctx .Uint64 ("conf_target" )),
67
+ SwapPublicationDeadline : uint64 (swapDeadline .Unix ()),
50
68
})
51
69
if err != nil {
52
70
return err
You can’t perform that action at this time.
0 commit comments