Merge pull request #4577 from zgfzgf/fix-chain-consensusfault

delete slash-consensus miner
This commit is contained in:
Łukasz Magiera 2021-01-11 15:53:42 +01:00 committed by GitHub
commit 6328f9c879
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1105,10 +1105,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",
@ -1142,6 +1138,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
@ -1186,17 +1186,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,