add mpool clear cli command
This commit is contained in:
parent
3027283756
commit
0c875774ce
17
cli/mpool.go
17
cli/mpool.go
@ -20,6 +20,7 @@ var mpoolCmd = &cli.Command{
|
||||
Usage: "Manage message pool",
|
||||
Subcommands: []*cli.Command{
|
||||
mpoolPending,
|
||||
mpoolClear,
|
||||
mpoolSub,
|
||||
mpoolStat,
|
||||
mpoolReplaceCmd,
|
||||
@ -83,6 +84,22 @@ var mpoolPending = &cli.Command{
|
||||
},
|
||||
}
|
||||
|
||||
var mpoolClear = &cli.Command{
|
||||
Name: "clear",
|
||||
Usage: "Clear all pending messages from the mpool (USE WITH CARE)",
|
||||
Action: func(cctx *cli.Context) error {
|
||||
api, closer, err := GetFullNodeAPI(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer closer()
|
||||
|
||||
ctx := ReqContext(cctx)
|
||||
|
||||
return api.MpoolClear(ctx)
|
||||
},
|
||||
}
|
||||
|
||||
var mpoolSub = &cli.Command{
|
||||
Name: "sub",
|
||||
Usage: "Subscribe to mpool changes",
|
||||
|
Loading…
Reference in New Issue
Block a user