@@ -350,6 +350,12 @@ var setParamsCommand = cli.Command{
350350 Usage : "the target size of total local balance in " +
351351 "satoshis, used by easy autoloop." ,
352352 },
353+ cli.StringFlag {
354+ Name : "asset_id" ,
355+ Usage : "If set to a valid asset ID, the easyautoloop " +
356+ "and localbalancesat flags will be set for the " +
357+ "specified asset." ,
358+ },
353359 },
354360 Action : setParams ,
355361}
@@ -515,14 +521,34 @@ func setParams(ctx *cli.Context) error {
515521 flagSet = true
516522 }
517523
524+ // If we are setting easy autoloop parameters, we need to ensure that
525+ // the asset ID is set, and that we have a valid entry in our params
526+ // map.
527+ if ctx .IsSet (ctx .String ("asset_id" )) {
528+ if _ , ok := params .EasyAssetParams [ctx .String ("asset_id" )]; ! ok { //nolint:lll
529+ params .EasyAssetParams [ctx .String ("asset_id" )] =
530+ & looprpc.EasyAssetParams {}
531+ }
532+ }
533+
518534 if ctx .IsSet ("easyautoloop" ) {
519- params .EasyAutoloop = ctx .Bool ("easyautoloop" )
535+ if ctx .IsSet ("asset_id" ) {
536+ params .EasyAssetParams [ctx .String ("asset_id" )].
537+ Enabled = ctx .Bool ("easyautoloop" )
538+ } else {
539+ params .EasyAutoloop = ctx .Bool ("easyautoloop" )
540+ }
520541 flagSet = true
521542 }
522543
523544 if ctx .IsSet ("localbalancesat" ) {
524- params .EasyAutoloopLocalTargetSat =
525- ctx .Uint64 ("localbalancesat" )
545+ if ctx .IsSet ("asset_id" ) {
546+ params .EasyAssetParams [ctx .String ("asset_id" )].
547+ LocalTargetAssetAmt = ctx .Uint64 ("localbalancesat" ) // nolint:lll
548+ } else {
549+ params .EasyAutoloopLocalTargetSat =
550+ ctx .Uint64 ("localbalancesat" )
551+ }
526552 flagSet = true
527553 }
528554
0 commit comments