@@ -273,7 +273,15 @@ var queryMissionControlCommand = cli.Command{
273
273
Name : "querymc" ,
274
274
Category : "Mission Control" ,
275
275
Usage : "Query the internal mission control state." ,
276
- Action : actionDecorator (queryMissionControl ),
276
+ Flags : []cli.Flag {
277
+ & cli.StringFlag {
278
+ Name : "mission_control_namespace" ,
279
+ Usage : "an optional mission control namespace to query. " +
280
+ "If not specified, the default mission control " +
281
+ "namespace will be used." ,
282
+ },
283
+ },
284
+ Action : actionDecorator (queryMissionControl ),
277
285
}
278
286
279
287
func queryMissionControl (ctx * cli.Context ) error {
@@ -283,7 +291,9 @@ func queryMissionControl(ctx *cli.Context) error {
283
291
284
292
client := routerrpc .NewRouterClient (conn )
285
293
286
- req := & routerrpc.QueryMissionControlRequest {}
294
+ req := & routerrpc.QueryMissionControlRequest {
295
+ MissionControlNamespace : ctx .String ("mission_control_namespace" ),
296
+ }
287
297
snapshot , err := client .QueryMissionControl (ctxc , req )
288
298
if err != nil {
289
299
return err
@@ -299,8 +309,16 @@ var queryProbCommand = cli.Command{
299
309
Category : "Mission Control" ,
300
310
Usage : "Deprecated. Estimate a success probability." ,
301
311
ArgsUsage : "from-node to-node amt" ,
302
- Action : actionDecorator (queryProb ),
303
- Hidden : true ,
312
+ Flags : []cli.Flag {
313
+ & cli.StringFlag {
314
+ Name : "mission_control_namespace" ,
315
+ Usage : "an optional mission control namespace to query. " +
316
+ "If not specified, the default mission control " +
317
+ "namespace will be used." ,
318
+ },
319
+ },
320
+ Action : actionDecorator (queryProb ),
321
+ Hidden : true ,
304
322
}
305
323
306
324
func queryProb (ctx * cli.Context ) error {
@@ -336,9 +354,10 @@ func queryProb(ctx *cli.Context) error {
336
354
client := routerrpc .NewRouterClient (conn )
337
355
338
356
req := & routerrpc.QueryProbabilityRequest {
339
- FromNode : fromNode [:],
340
- ToNode : toNode [:],
341
- AmtMsat : int64 (amtMsat ),
357
+ FromNode : fromNode [:],
358
+ ToNode : toNode [:],
359
+ AmtMsat : int64 (amtMsat ),
360
+ MissionControlNamespace : ctx .String ("mission_control_namespace" ),
342
361
}
343
362
344
363
response , err := client .QueryProbability (ctxc , req )
@@ -355,7 +374,15 @@ var resetMissionControlCommand = cli.Command{
355
374
Name : "resetmc" ,
356
375
Category : "Mission Control" ,
357
376
Usage : "Reset internal mission control state." ,
358
- Action : actionDecorator (resetMissionControl ),
377
+ Flags : []cli.Flag {
378
+ & cli.StringFlag {
379
+ Name : "mission_control_namespace" ,
380
+ Usage : "an optional mission control namespace to reset. " +
381
+ "If not specified, the default mission control " +
382
+ "namespace will be used." ,
383
+ },
384
+ },
385
+ Action : actionDecorator (resetMissionControl ),
359
386
}
360
387
361
388
func resetMissionControl (ctx * cli.Context ) error {
@@ -365,7 +392,9 @@ func resetMissionControl(ctx *cli.Context) error {
365
392
366
393
client := routerrpc .NewRouterClient (conn )
367
394
368
- req := & routerrpc.ResetMissionControlRequest {}
395
+ req := & routerrpc.ResetMissionControlRequest {
396
+ MissionControlNamespace : ctx .String ("mission_control_namespace" ),
397
+ }
369
398
_ , err := client .ResetMissionControl (ctxc , req )
370
399
371
400
return err
0 commit comments