mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
cmd/loop: add an option for max off chain swap fee
This commit is contained in:
parent
1ea58ad3d6
commit
321f5f791d
1 changed files with 12 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ import (
|
|||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/btcsuite/btcutil"
|
||||
"github.com/lightninglabs/loop"
|
||||
"github.com/lightninglabs/loop/looprpc"
|
||||
"github.com/lightninglabs/loop/swap"
|
||||
|
|
@ -45,6 +46,11 @@ var loopOutCommand = cli.Command{
|
|||
"should be swept within",
|
||||
Value: uint64(loop.DefaultSweepConfTarget),
|
||||
},
|
||||
cli.Int64Flag{
|
||||
Name: "max_swap_routing_fee",
|
||||
Usage: "the max off-chain swap routing fee in satoshis, " +
|
||||
"if let blank a default max fee will be used",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "fast",
|
||||
Usage: "Indicate you want to swap immediately, " +
|
||||
|
|
@ -115,6 +121,12 @@ func loopOut(ctx *cli.Context) error {
|
|||
}
|
||||
|
||||
limits := getLimits(amt, quote)
|
||||
// If configured, use the specified maximum swap routing fee.
|
||||
if ctx.IsSet("max_swap_routing_fee") {
|
||||
*limits.maxSwapRoutingFee = btcutil.Amount(
|
||||
ctx.Int64("max_swap_routing_fee"),
|
||||
)
|
||||
}
|
||||
err = displayLimits(swap.TypeOut, amt, limits, false, warning)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue