Add additional checks to ACF

Fixes https://github.com/filecoin-project/lotus/issues/1074

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2020-01-14 13:22:41 +01:00
parent 4f1bead0de
commit c2fdca470d
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA

View File

@ -130,6 +130,10 @@ type ArbitrateConsensusFaultParams struct {
} }
func (spa StoragePowerActor) ArbitrateConsensusFault(act *types.Actor, vmctx types.VMContext, params *ArbitrateConsensusFaultParams) ([]byte, ActorError) { func (spa StoragePowerActor) ArbitrateConsensusFault(act *types.Actor, vmctx types.VMContext, params *ArbitrateConsensusFaultParams) ([]byte, ActorError) {
if params == nil || params.Block1 == nil || params.Block2 == nil {
return nil, aerrors.New(1, "failed to parse params")
}
if params.Block1.Miner != params.Block2.Miner { if params.Block1.Miner != params.Block2.Miner {
return nil, aerrors.New(2, "blocks must be from the same miner") return nil, aerrors.New(2, "blocks must be from the same miner")
} }