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",
|
Usage: "Manage message pool",
|
||||||
Subcommands: []*cli.Command{
|
Subcommands: []*cli.Command{
|
||||||
mpoolPending,
|
mpoolPending,
|
||||||
|
mpoolClear,
|
||||||
mpoolSub,
|
mpoolSub,
|
||||||
mpoolStat,
|
mpoolStat,
|
||||||
mpoolReplaceCmd,
|
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{
|
var mpoolSub = &cli.Command{
|
||||||
Name: "sub",
|
Name: "sub",
|
||||||
Usage: "Subscribe to mpool changes",
|
Usage: "Subscribe to mpool changes",
|
||||||
|
Loading…
Reference in New Issue
Block a user