Skip to content

Commit cd9f6f1

Browse files
committed
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.
1 parent 0a19485 commit cd9f6f1

File tree

4 files changed

+241
-163
lines changed

4 files changed

+241
-163
lines changed

cmd/loop/liquidity.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,17 @@ var setParamsCommand = cli.Command{
324324
Usage: "the confirmation target for loop in on-chain " +
325325
"htlcs",
326326
},
327+
cli.BoolFlag{
328+
Name: "easyautoloop",
329+
Usage: "set to true to enable easy autoloop, which " +
330+
"will automatically dispatch swaps in order " +
331+
"to meet the target local balance",
332+
},
333+
cli.Uint64Flag{
334+
Name: "localbalancesat",
335+
Usage: "the target size of total local balance in " +
336+
"satoshis, used by easy autoloop",
337+
},
327338
},
328339
Action: setParams,
329340
}
@@ -465,6 +476,17 @@ func setParams(ctx *cli.Context) error {
465476
flagSet = true
466477
}
467478

479+
if ctx.IsSet("easyautoloop") {
480+
params.EasyAutoloop = ctx.Bool("easyautoloop")
481+
flagSet = true
482+
}
483+
484+
if ctx.IsSet("localbalancesat") {
485+
params.EasyAutoloopLocalTargetSat =
486+
ctx.Uint64("localbalancesat")
487+
flagSet = true
488+
}
489+
468490
if !flagSet {
469491
return fmt.Errorf("at least one flag required to set params")
470492
}

0 commit comments

Comments
 (0)