Merge pull request #599 from gguoss/patch-1
Keep the context consistent
This commit is contained in:
commit
483f4aed44
@ -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) {
|
func (sm *StateManager) ListAllActors(ctx context.Context, ts *types.TipSet) ([]address.Address, error) {
|
||||||
if ts == nil {
|
if ts == nil {
|
||||||
ts = sm.ChainStore().GetHeaviestTipSet()
|
ts = sm.cs.GetHeaviestTipSet()
|
||||||
}
|
}
|
||||||
st, _, err := sm.TipSetState(ctx, ts)
|
st, _, err := sm.TipSetState(ctx, ts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
cst := hamt.CSTFromBstore(sm.ChainStore().Blockstore())
|
cst := hamt.CSTFromBstore(sm.cs.Blockstore())
|
||||||
r, err := hamt.LoadNode(ctx, cst, st)
|
r, err := hamt.LoadNode(ctx, cst, st)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
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 {
|
if _, err := sm.LoadActorState(ctx, actors.StorageMarketAddress, &state, ts); err != nil {
|
||||||
return actors.StorageParticipantBalance{}, err
|
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)
|
b, _, err := actors.GetMarketBalances(ctx, cst, state.Balances, addr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return actors.StorageParticipantBalance{}, err
|
return actors.StorageParticipantBalance{}, err
|
||||||
|
Loading…
Reference in New Issue
Block a user