lncli: add reset mission control command
This commit is contained in:
parent
26b2c79159
commit
865801c881
30
cmd/lncli/cmd_reset_mission_control.go
Normal file
30
cmd/lncli/cmd_reset_mission_control.go
Normal file
@ -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
|
||||||
|
}
|
@ -6,5 +6,5 @@ import "github.com/urfave/cli"
|
|||||||
|
|
||||||
// routerCommands will return nil for non-routerrpc builds.
|
// routerCommands will return nil for non-routerrpc builds.
|
||||||
func routerCommands() []cli.Command {
|
func routerCommands() []cli.Command {
|
||||||
return []cli.Command{queryMissionControlCommand}
|
return []cli.Command{queryMissionControlCommand, resetMissionControlCommand}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user