From 0e78db3b8ce8a0258d94633ac90dedcf4a0657e6 Mon Sep 17 00:00:00 2001 From: whyrusleeping Date: Thu, 30 Jul 2020 10:32:10 -0700 Subject: [PATCH] print out selected messages in mpool shed cmd --- cmd/lotus-shed/mpool.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cmd/lotus-shed/mpool.go b/cmd/lotus-shed/mpool.go index b2500c864..6121e2862 100644 --- a/cmd/lotus-shed/mpool.go +++ b/cmd/lotus-shed/mpool.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/chain/types" lcli "github.com/filecoin-project/lotus/cli" "github.com/filecoin-project/lotus/miner" "github.com/urfave/cli/v2" @@ -45,7 +46,18 @@ var minerSelectMsgsCmd = &cli.Command{ } var totalGas int64 - for _, f := range filtered { + for i, f := range filtered { + from := f.Message.From.String() + if len(from) > 8 { + from = "..." + from[len(from)-8:] + } + + to := f.Message.To.String() + if len(to) > 8 { + to = "..." + to[len(to)-8:] + } + + fmt.Printf("%d: %s -> %s, method %d, gasPrice %s, gasLimit %d, val %s\n", i, from, to, f.Message.Method, f.Message.GasPrice, f.Message.GasLimit, types.FIL(f.Message.Value)) totalGas += f.Message.GasLimit }