Skip to content

Commit

Permalink
allow slash failed (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
unclezoro authored and HaoyangLiu committed Jul 3, 2020
1 parent ef1e874 commit d7dbf80
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions consensus/parlia/parlia.go
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,8 @@ func (p *Parlia) Finalize(chain consensus.ChainReader, header *types.Header, sta
log.Info("slash validator", "block hash", header.Hash(), "address", spoiledVal)
err = p.slash(spoiledVal, state, header, cx, txs, receipts, systemTxs, usedGas, false)
if err != nil {
panic(err)
// it is possible that slash validator failed because of the slash channel is disabled.
log.Error("slash validator failed", "block hash", header.Hash(), "address", spoiledVal)
}
}
}
Expand Down Expand Up @@ -735,7 +736,8 @@ func (p *Parlia) FinalizeAndAssemble(chain consensus.ChainReader, header *types.
if !signedRecently {
err = p.slash(spoiledVal, state, header, cx, &txs, &receipts, nil, &header.GasUsed, true)
if err != nil {
panic(err)
// it is possible that slash validator failed because of the slash channel is disabled.
log.Error("slash validator failed", "block hash", header.Hash(), "address", spoiledVal)
}
}
}
Expand Down

0 comments on commit d7dbf80

Please sign in to comment.