From fe40a53e8f12cd8f595a3b6a4b204cb146213c80 Mon Sep 17 00:00:00 2001 From: zgfzgf <1901989065@qq.com> Date: Sat, 24 Oct 2020 13:46:15 +0800 Subject: [PATCH] delete slash-consensus miner --- cli/chain.go | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/cli/chain.go b/cli/chain.go index e2d0ebb4a..53db7e82e 100644 --- a/cli/chain.go +++ b/cli/chain.go @@ -1101,10 +1101,6 @@ var slashConsensusFault = &cli.Command{ Usage: "Report consensus fault", ArgsUsage: "[blockCid1 blockCid2]", Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "miner", - Usage: "Miner address", - }, &cli.StringFlag{ Name: "extra", Usage: "Extra block cid", @@ -1138,6 +1134,10 @@ var slashConsensusFault = &cli.Command{ return xerrors.Errorf("getting block 2: %w", err) } + if b1.Miner != b2.Miner { + return xerrors.Errorf("block1.miner:%s block2.miner:%s", b1.Miner, b2.Miner) + } + def, err := api.WalletDefaultAddress(ctx) if err != nil { return err @@ -1182,17 +1182,8 @@ var slashConsensusFault = &cli.Command{ return err } - if cctx.String("miner") == "" { - return xerrors.Errorf("--miner flag is required") - } - - maddr, err := address.NewFromString(cctx.String("miner")) - if err != nil { - return err - } - msg := &types.Message{ - To: maddr, + To: b2.Miner, From: def, Value: types.NewInt(0), Method: builtin.MethodsMiner.ReportConsensusFault,