mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-18 13:08:28 +02:00
cmd+looprpc: add new parameters for easy autoloop
This commit introduces the new parameters to the protofiles and the cmd interface. If easy autoloop is enabled we just ignore the rest of the rules and use the defaults of easy autoloop.
This commit is contained in:
parent
0a19485409
commit
cd9f6f142b
4 changed files with 241 additions and 163 deletions
|
|
@ -324,6 +324,17 @@ var setParamsCommand = cli.Command{
|
|||
Usage: "the confirmation target for loop in on-chain " +
|
||||
"htlcs",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "easyautoloop",
|
||||
Usage: "set to true to enable easy autoloop, which " +
|
||||
"will automatically dispatch swaps in order " +
|
||||
"to meet the target local balance",
|
||||
},
|
||||
cli.Uint64Flag{
|
||||
Name: "localbalancesat",
|
||||
Usage: "the target size of total local balance in " +
|
||||
"satoshis, used by easy autoloop",
|
||||
},
|
||||
},
|
||||
Action: setParams,
|
||||
}
|
||||
|
|
@ -465,6 +476,17 @@ func setParams(ctx *cli.Context) error {
|
|||
flagSet = true
|
||||
}
|
||||
|
||||
if ctx.IsSet("easyautoloop") {
|
||||
params.EasyAutoloop = ctx.Bool("easyautoloop")
|
||||
flagSet = true
|
||||
}
|
||||
|
||||
if ctx.IsSet("localbalancesat") {
|
||||
params.EasyAutoloopLocalTargetSat =
|
||||
ctx.Uint64("localbalancesat")
|
||||
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