From 32eb647215d2cb4b5bc8477e279eafafa92cd06b Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Thu, 3 Sep 2020 00:49:17 -0400 Subject: [PATCH] Update MinerEligibleForElection --- chain/stmgr/utils.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/chain/stmgr/utils.go b/chain/stmgr/utils.go index d8f2750dd..4d1199eb7 100644 --- a/chain/stmgr/utils.go +++ b/chain/stmgr/utils.go @@ -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) }