polish(statetree): accept a context in statetree diff for timeouts

- this operation can take a while, this changes gives users the option
to abort if it takes "too long".
This commit is contained in:
frrist
2021-06-30 16:40:43 -07:00
parent 6a5b94ca3b
commit d02a2a2cfa
2 changed files with 32 additions and 27 deletions
+1 -1
View File
@@ -705,7 +705,7 @@ func (a *StateAPI) StateChangedActors(ctx context.Context, old cid.Cid, new cid.
return nil, xerrors.Errorf("failed to load new state tree: %w", err)
}
return state.Diff(oldTree, newTree)
return state.Diff(ctx, oldTree, newTree)
}
func (a *StateAPI) StateMinerSectorCount(ctx context.Context, addr address.Address, tsk types.TipSetKey) (api.MinerSectors, error) {