Skip to content

Commit

Permalink
fix mpool.GetActorAfter doesnt compute tipset-state base on needs
Browse files Browse the repository at this point in the history
  • Loading branch information
zl03jsj committed Feb 28, 2022
1 parent 5a718b5 commit 98a9486
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/messagepool/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,24 @@ func (mpp *mpoolProvider) PubSubPublish(ctx context.Context, k string, v []byte)

func (mpp *mpoolProvider) GetActorAfter(ctx context.Context, addr address.Address, ts *types.TipSet) (*types.Actor, error) {
if mpp.IsLite() {
n, err := mpp.lite.GetNonce(context.TODO(), addr, ts.Key())
n, err := mpp.lite.GetNonce(ctx, addr, ts.Key())
if err != nil {
return nil, xerrors.Errorf("getting nonce over lite: %w", err)
}
a, err := mpp.lite.GetActor(context.TODO(), addr, ts.Key())
a, err := mpp.lite.GetActor(ctx, addr, ts.Key())
if err != nil {
return nil, xerrors.Errorf("getting actor over lite: %w", err)
}
a.Nonce = n
return a, nil
}

st, err := mpp.sm.GetTipSetState(context.TODO(), ts)
st, err := mpp.stmgr.TipsetState(ctx, ts)
if err != nil {
return nil, xerrors.Errorf("computing tipset state for GetActor: %v", err)
}

act, found, err := st.GetActor(context.TODO(), addr)
act, found, err := st.GetActor(ctx, addr)
if !found {
err = xerrors.New("actor not found")
}
Expand Down

0 comments on commit 98a9486

Please sign in to comment.