cmd/loop: add an option for max off chain swap fee

pull/128/head
FreeThinker 4 years ago
parent 1ea58ad3d6
commit 321f5f791d

@ -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…
Cancel
Save