delete slash-consensus miner

This commit is contained in:
zgfzgf 2020-10-24 13:46:15 +08:00
parent 194f56377e
commit fe40a53e8f

View File

@ -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,