Skip to content

Commit 321f5f7

Browse files
cmd/loop: add an option for max off chain swap fee
1 parent 1ea58ad commit 321f5f7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cmd/loop/loopout.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"time"
77

8+
"github.com/btcsuite/btcutil"
89
"github.com/lightninglabs/loop"
910
"github.com/lightninglabs/loop/looprpc"
1011
"github.com/lightninglabs/loop/swap"
@@ -45,6 +46,11 @@ var loopOutCommand = cli.Command{
4546
"should be swept within",
4647
Value: uint64(loop.DefaultSweepConfTarget),
4748
},
49+
cli.Int64Flag{
50+
Name: "max_swap_routing_fee",
51+
Usage: "the max off-chain swap routing fee in satoshis, " +
52+
"if let blank a default max fee will be used",
53+
},
4854
cli.BoolFlag{
4955
Name: "fast",
5056
Usage: "Indicate you want to swap immediately, " +
@@ -115,6 +121,12 @@ func loopOut(ctx *cli.Context) error {
115121
}
116122

117123
limits := getLimits(amt, quote)
124+
// If configured, use the specified maximum swap routing fee.
125+
if ctx.IsSet("max_swap_routing_fee") {
126+
*limits.maxSwapRoutingFee = btcutil.Amount(
127+
ctx.Int64("max_swap_routing_fee"),
128+
)
129+
}
118130
err = displayLimits(swap.TypeOut, amt, limits, false, warning)
119131
if err != nil {
120132
return err

0 commit comments

Comments
 (0)