mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
loop: add autoout parameters to cli
This commit is contained in:
parent
eb6b476469
commit
a2edd78f5a
1 changed files with 44 additions and 0 deletions
|
|
@ -224,6 +224,30 @@ var setParamsCommand = cli.Command{
|
|||
"previously had a failed swap will be " +
|
||||
"included in suggestions.",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "autoout",
|
||||
Usage: "set to true to enable automated dispatch " +
|
||||
"of loop out swaps, limited to the budget " +
|
||||
"set by autobudget",
|
||||
},
|
||||
cli.Uint64Flag{
|
||||
Name: "autobudget",
|
||||
Usage: "the maximum amount of fees in satoshis that " +
|
||||
"automatically dispatched loop out swaps may " +
|
||||
"spend",
|
||||
},
|
||||
cli.Uint64Flag{
|
||||
Name: "budgetstart",
|
||||
Usage: "the start time for the automated loop " +
|
||||
"out budget, expressed as a unix timestamp " +
|
||||
"in seconds",
|
||||
},
|
||||
cli.Uint64Flag{
|
||||
Name: "autoinflight",
|
||||
Usage: "the maximum number of automatically " +
|
||||
"dispatched swaps that we allow to be in " +
|
||||
"flight",
|
||||
},
|
||||
},
|
||||
Action: setParams,
|
||||
}
|
||||
|
|
@ -304,6 +328,26 @@ func setParams(ctx *cli.Context) error {
|
|||
flagSet = true
|
||||
}
|
||||
|
||||
if ctx.IsSet("autoout") {
|
||||
params.AutoLoopOut = ctx.Bool("autoout")
|
||||
flagSet = true
|
||||
}
|
||||
|
||||
if ctx.IsSet("autobudget") {
|
||||
params.AutoOutBudgetSat = ctx.Uint64("autobudget")
|
||||
flagSet = true
|
||||
}
|
||||
|
||||
if ctx.IsSet("budgetstart") {
|
||||
params.AutoOutBudgetStartSec = ctx.Uint64("budgetstart")
|
||||
flagSet = true
|
||||
}
|
||||
|
||||
if ctx.IsSet("autoinflight") {
|
||||
params.AutoMaxInFlight = ctx.Uint64("autoinflight")
|
||||
flagSet = true
|
||||
}
|
||||
|
||||
if !flagSet {
|
||||
return fmt.Errorf("at least one flag required to set params")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue