Skip to content

Commit

Permalink
Merge pull request #4577 from zgfzgf/fix-chain-consensusfault
Browse files Browse the repository at this point in the history
delete slash-consensus miner
  • Loading branch information
magik6k authored Jan 11, 2021
2 parents 3fb605a + fe40a53 commit 6328f9c
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions cli/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 6328f9c

Please sign in to comment.