I circled it in the picture
That is the voltage regulator for the charging system. The coil and igniter are bolted together and right next to the voltage regulator in your pic. Normally When the igniter goes it won't run at all. Is it running ritch at all? How does it run besides the idle problem?