From ad2759dc94aa8200d6d12958e6f5cac419ea231d Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Tue, 18 Jun 2019 09:37:44 +0200 Subject: [PATCH 1/3] lncli: assign category to SendToRoute command --- cmd/lncli/commands.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/lncli/commands.go b/cmd/lncli/commands.go index d2f9414e..11b73444 100644 --- a/cmd/lncli/commands.go +++ b/cmd/lncli/commands.go @@ -2363,8 +2363,9 @@ func payInvoice(ctx *cli.Context) error { } var sendToRouteCommand = cli.Command{ - Name: "sendtoroute", - Usage: "send a payment over a predefined route", + Name: "sendtoroute", + Category: "Payments", + Usage: "Send a payment over a predefined route.", Description: ` Send a payment over Lightning using a specific route. One must specify a list of routes to attempt and the payment hash. This command can even From 26b2c791592535fd906930fc58b8a8ba3212430b Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Wed, 19 Jun 2019 09:20:58 +0200 Subject: [PATCH 2/3] lncli: add usage to querymc command --- cmd/lncli/cmd_query_mission_control.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/lncli/cmd_query_mission_control.go b/cmd/lncli/cmd_query_mission_control.go index b8764d37..f1514beb 100644 --- a/cmd/lncli/cmd_query_mission_control.go +++ b/cmd/lncli/cmd_query_mission_control.go @@ -14,6 +14,7 @@ import ( var queryMissionControlCommand = cli.Command{ Name: "querymc", Category: "Payments", + Usage: "Query the internal mission control state.", Action: actionDecorator(queryMissionControl), } From 865801c88174c2bf7fd199a905a625a794602bae Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Wed, 19 Jun 2019 09:22:18 +0200 Subject: [PATCH 3/3] lncli: add reset mission control command --- cmd/lncli/cmd_reset_mission_control.go | 30 ++++++++++++++++++++++++++ cmd/lncli/routerrpc_active.go | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 cmd/lncli/cmd_reset_mission_control.go diff --git a/cmd/lncli/cmd_reset_mission_control.go b/cmd/lncli/cmd_reset_mission_control.go new file mode 100644 index 00000000..db37fd4b --- /dev/null +++ b/cmd/lncli/cmd_reset_mission_control.go @@ -0,0 +1,30 @@ +// +build routerrpc + +package main + +import ( + "context" + + "github.com/lightningnetwork/lnd/lnrpc/routerrpc" + + "github.com/urfave/cli" +) + +var resetMissionControlCommand = cli.Command{ + Name: "resetmc", + Category: "Payments", + Usage: "Reset internal mission control state.", + Action: actionDecorator(resetMissionControl), +} + +func resetMissionControl(ctx *cli.Context) error { + conn := getClientConn(ctx, false) + defer conn.Close() + + client := routerrpc.NewRouterClient(conn) + + req := &routerrpc.ResetMissionControlRequest{} + rpcCtx := context.Background() + _, err := client.ResetMissionControl(rpcCtx, req) + return err +} diff --git a/cmd/lncli/routerrpc_active.go b/cmd/lncli/routerrpc_active.go index 4a34d6b1..f323aed1 100644 --- a/cmd/lncli/routerrpc_active.go +++ b/cmd/lncli/routerrpc_active.go @@ -6,5 +6,5 @@ import "github.com/urfave/cli" // routerCommands will return nil for non-routerrpc builds. func routerCommands() []cli.Command { - return []cli.Command{queryMissionControlCommand} + return []cli.Command{queryMissionControlCommand, resetMissionControlCommand} }