Merge pull request #3108 from austinabell/msload

Remove unnecessary miner state load for checking slashed
This commit is contained in:
Łukasz Magiera 2020-08-17 18:11:09 +02:00 committed by GitHub
commit 704578c9c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -293,14 +293,8 @@ func StateMinerInfo(ctx context.Context, sm *StateManager, ts *types.TipSet, mad
} }
func GetMinerSlashed(ctx context.Context, sm *StateManager, ts *types.TipSet, maddr address.Address) (bool, error) { func GetMinerSlashed(ctx context.Context, sm *StateManager, ts *types.TipSet, maddr address.Address) (bool, error) {
var mas miner.State
_, err := sm.LoadActorState(ctx, maddr, &mas, ts)
if err != nil {
return false, xerrors.Errorf("(get miner slashed) failed to load miner actor state")
}
var spas power.State var spas power.State
_, err = sm.LoadActorState(ctx, builtin.StoragePowerActorAddr, &spas, ts) _, err := sm.LoadActorState(ctx, builtin.StoragePowerActorAddr, &spas, ts)
if err != nil { if err != nil {
return false, xerrors.Errorf("(get miner slashed) failed to load power actor state") return false, xerrors.Errorf("(get miner slashed) failed to load power actor state")
} }