mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
cmd/loop: account for fast swap in loopout cmd quote
This commit is contained in:
parent
dcc5a8ce88
commit
18608a6aa3
1 changed files with 11 additions and 10 deletions
|
|
@ -93,10 +93,19 @@ func loopOut(ctx *cli.Context) error {
|
|||
}
|
||||
defer cleanup()
|
||||
|
||||
// Set our maximum swap wait time. If a fast swap is requested we set
|
||||
// it to now, otherwise to 30 minutes in the future.
|
||||
fast := ctx.Bool("fast")
|
||||
swapDeadline := time.Now()
|
||||
if !fast {
|
||||
swapDeadline = time.Now().Add(defaultSwapWaitTime)
|
||||
}
|
||||
|
||||
sweepConfTarget := int32(ctx.Uint64("conf_target"))
|
||||
quoteReq := &looprpc.QuoteRequest{
|
||||
Amt: int64(amt),
|
||||
ConfTarget: sweepConfTarget,
|
||||
Amt: int64(amt),
|
||||
ConfTarget: sweepConfTarget,
|
||||
SwapPublicationDeadline: uint64(swapDeadline.Unix()),
|
||||
}
|
||||
quote, err := client.LoopOutQuote(context.Background(), quoteReq)
|
||||
if err != nil {
|
||||
|
|
@ -104,7 +113,6 @@ func loopOut(ctx *cli.Context) error {
|
|||
}
|
||||
|
||||
// Show a warning if a slow swap was requested.
|
||||
fast := ctx.Bool("fast")
|
||||
warning := ""
|
||||
if fast {
|
||||
warning = "Fast swap requested."
|
||||
|
|
@ -125,13 +133,6 @@ func loopOut(ctx *cli.Context) error {
|
|||
unchargeChannel = ctx.Uint64("channel")
|
||||
}
|
||||
|
||||
// Set our maximum swap wait time. If a fast swap is requested we set
|
||||
// it to now, otherwise to 30 minutes in the future.
|
||||
swapDeadline := time.Now()
|
||||
if !fast {
|
||||
swapDeadline = time.Now().Add(defaultSwapWaitTime)
|
||||
}
|
||||
|
||||
resp, err := client.LoopOut(context.Background(), &looprpc.LoopOutRequest{
|
||||
Amt: int64(amt),
|
||||
Dest: destAddr,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue