loop: add autoout parameters to cli

pull/295/head
carla 4 years ago
parent eb6b476469
commit a2edd78f5a
No known key found for this signature in database
GPG Key ID: 4CA7FE54A6213C91

@ -224,6 +224,30 @@ var setParamsCommand = cli.Command{
"previously had a failed swap will be " + "previously had a failed swap will be " +
"included in suggestions.", "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, Action: setParams,
} }
@ -304,6 +328,26 @@ func setParams(ctx *cli.Context) error {
flagSet = true 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 { if !flagSet {
return fmt.Errorf("at least one flag required to set params") return fmt.Errorf("at least one flag required to set params")
} }

Loading…
Cancel
Save