2019-05-10 11:39:16 +03:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/lightningnetwork/lnd/lnrpc/routerrpc"
|
|
|
|
|
|
|
|
"github.com/urfave/cli"
|
|
|
|
)
|
|
|
|
|
|
|
|
var queryMissionControlCommand = cli.Command{
|
|
|
|
Name: "querymc",
|
|
|
|
Category: "Payments",
|
2019-06-19 10:20:58 +03:00
|
|
|
Usage: "Query the internal mission control state.",
|
2019-05-10 11:39:16 +03:00
|
|
|
Action: actionDecorator(queryMissionControl),
|
|
|
|
}
|
|
|
|
|
|
|
|
func queryMissionControl(ctx *cli.Context) error {
|
2020-07-18 18:46:16 +03:00
|
|
|
ctxc := getContext()
|
2019-05-10 11:39:16 +03:00
|
|
|
conn := getClientConn(ctx, false)
|
|
|
|
defer conn.Close()
|
|
|
|
|
|
|
|
client := routerrpc.NewRouterClient(conn)
|
|
|
|
|
|
|
|
req := &routerrpc.QueryMissionControlRequest{}
|
2020-07-18 18:46:16 +03:00
|
|
|
snapshot, err := client.QueryMissionControl(ctxc, req)
|
2019-05-10 11:39:16 +03:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2019-12-20 12:05:08 +03:00
|
|
|
printRespJSON(snapshot)
|
2019-05-10 11:39:16 +03:00
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|