@@ -106,7 +106,7 @@ func setRule(ctx *cli.Context) error {
106106 // We need to set the full set of current parameters every time we call
107107 // SetParameters. To allow users to set only individual fields on the
108108 // cli, we lookup our current params, then update individual values.
109- params , err := client .GetLiquidityParams (
109+ paramsResponse , err := client .GetLiquidityParams (
110110 context .Background (), & looprpc.GetLiquidityParamsRequest {},
111111 )
112112 if err != nil {
@@ -120,6 +120,12 @@ func setRule(ctx *cli.Context) error {
120120 otherRules []* looprpc.LiquidityRule
121121 )
122122
123+ // We're only interested in the btc rules for now.
124+ params , ok := paramsResponse .Rules ["BTC" ]
125+ if ! ok {
126+ return errors .New ("no rules set for BTC" )
127+ }
128+
123129 // Run through our current set of rules and check whether we have a rule
124130 // currently set for this channel or peer. We also track a slice
125131 // containing all of the rules we currently have set for other channels,
@@ -160,6 +166,7 @@ func setRule(ctx *cli.Context) error {
160166 context .Background (),
161167 & looprpc.SetLiquidityParamsRequest {
162168 Parameters : params ,
169+ AssetId : "btc" ,
163170 },
164171 )
165172 return err
@@ -216,6 +223,7 @@ func setRule(ctx *cli.Context) error {
216223 context .Background (),
217224 & looprpc.SetLiquidityParamsRequest {
218225 Parameters : params ,
226+ AssetId : "btc" ,
219227 },
220228 )
221229
@@ -364,13 +372,19 @@ func setParams(ctx *cli.Context) error {
364372 // We need to set the full set of current parameters every time we call
365373 // SetParameters. To allow users to set only individual fields on the
366374 // cli, we lookup our current params, then update individual values.
367- params , err := client .GetLiquidityParams (
375+ paramsResponse , err := client .GetLiquidityParams (
368376 context .Background (), & looprpc.GetLiquidityParamsRequest {},
369377 )
370378 if err != nil {
371379 return err
372380 }
373381
382+ // We're only interested in the btc rules for now.
383+ params , ok := paramsResponse .Rules ["BTC" ]
384+ if ! ok {
385+ return errors .New ("no rules set for BTC" )
386+ }
387+
374388 var flagSet , categoriesSet , feePercentSet bool
375389
376390 // Update our existing parameters with the values provided by cli flags.
@@ -556,6 +570,7 @@ func setParams(ctx *cli.Context) error {
556570 _ , err = client .SetLiquidityParams (
557571 context .Background (), & looprpc.SetLiquidityParamsRequest {
558572 Parameters : params ,
573+ AssetId : "btc" ,
559574 },
560575 )
561576
0 commit comments