Merge pull request #128 from Free-FreeThinker/free--max-routing-fee-config

Add option for max swap off-chain routing fee
pull/133/head
Olaoluwa Osuntokun 4 years ago committed by GitHub
commit e4ffb0803c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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, " +
@ -123,6 +129,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