Merge pull request #599 from gguoss/patch-1

Keep the context consistent
This commit is contained in:
Łukasz Magiera 2019-11-14 17:17:14 +01:00 committed by GitHub
commit 483f4aed44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -437,14 +437,14 @@ func (sm *StateManager) tipsetExecutedMessage(ts *types.TipSet, msg cid.Cid) (*t
func (sm *StateManager) ListAllActors(ctx context.Context, ts *types.TipSet) ([]address.Address, error) {
if ts == nil {
ts = sm.ChainStore().GetHeaviestTipSet()
ts = sm.cs.GetHeaviestTipSet()
}
st, _, err := sm.TipSetState(ctx, ts)
if err != nil {
return nil, err
}
cst := hamt.CSTFromBstore(sm.ChainStore().Blockstore())
cst := hamt.CSTFromBstore(sm.cs.Blockstore())
r, err := hamt.LoadNode(ctx, cst, st)
if err != nil {
return nil, err
@ -471,7 +471,7 @@ func (sm *StateManager) MarketBalance(ctx context.Context, addr address.Address,
if _, err := sm.LoadActorState(ctx, actors.StorageMarketAddress, &state, ts); err != nil {
return actors.StorageParticipantBalance{}, err
}
cst := hamt.CSTFromBstore(sm.ChainStore().Blockstore())
cst := hamt.CSTFromBstore(sm.cs.Blockstore())
b, _, err := actors.GetMarketBalances(ctx, cst, state.Balances, addr)
if err != nil {
return actors.StorageParticipantBalance{}, err