Skip to content

Commit

Permalink
Merge pull request #4508 from filecoin-project/fix/actor-not-found-mi…
Browse files Browse the repository at this point in the history
…ninig-base

MinerGetBaseInfo: if miner is not found in lookback, check current
  • Loading branch information
magik6k authored Oct 22, 2020
2 parents 6c800bd + 6530431 commit b2510e5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions chain/stmgr/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,12 +460,21 @@ func MinerGetBaseInfo(ctx context.Context, sm *StateManager, bcs beacon.Schedule
return nil, xerrors.Errorf("getting lookback miner actor state: %w", err)
}

// TODO: load the state instead of computing it?
lbst, _, err := sm.TipSetState(ctx, lbts)
if err != nil {
return nil, err
}

act, err := sm.LoadActorRaw(ctx, maddr, lbst)
if xerrors.Is(err, types.ErrActorNotFound) {
_, err := sm.LoadActor(ctx, maddr, ts)
if err != nil {
return nil, xerrors.Errorf("loading miner in current state: %w", err)
}

return nil, nil
}
if err != nil {
return nil, xerrors.Errorf("failed to load miner actor: %w", err)
}
Expand Down

0 comments on commit b2510e5

Please sign in to comment.