Update MinerEligibleForElection

This commit is contained in:
Aayush Rajasekaran 2020-09-03 00:49:17 -04:00
parent ccfbf557c7
commit 32eb647215

View File

@ -656,7 +656,13 @@ func MinerEligibleForElection(ctx context.Context, sm *StateManager, addr addres
return false, xerrors.Errorf("loading reward actor state: %w", err)
}
ret, err := miner.MinerEligibleForElection(sm.cs.Store(ctx), &ms, rs.ThisEpochReward, ts.Height())
var ps power.State
_, err = sm.LoadActorState(ctx, builtin.StoragePowerActorAddr, &ps, ts)
if err != nil {
return false, xerrors.Errorf("loading power actor state: %w", err)
}
ret, err := miner.MinerEligibleForElection(sm.cs.Store(ctx), addr, &ms, &ps, rs.ThisEpochReward, ts.Height())
if err != nil {
return false, xerrors.Errorf("determining election eligibility: %w", err)
}