With a view to doing substantial justice, the attorney general is authorized to compromise or settle any suit permitted under this chapter, with the approval of the court in which suit is pending.