Merge pull request #614 from filecoin-project/fix/st-mpow-slashed-again

Fix StateMinerPower again
This commit is contained in:
Łukasz Magiera 2019-11-15 02:28:24 +01:00 committed by GitHub
commit 693f9d7582
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,12 +52,14 @@ func (a *StateAPI) StateMinerPower(ctx context.Context, maddr address.Address, t
return api.MinerPower{}, err
}
slashed, err := stmgr.GetMinerSlashed(ctx, a.StateManager, ts, maddr)
if err != nil {
return api.MinerPower{}, err
}
if slashed != 0 {
mpow = types.NewInt(0)
if maddr != address.Undef {
slashed, err := stmgr.GetMinerSlashed(ctx, a.StateManager, ts, maddr)
if err != nil {
return api.MinerPower{}, err
}
if slashed != 0 {
mpow = types.NewInt(0)
}
}
return api.MinerPower{