code: func (m *CPUMiner) Stop() {
  	m.Lock()
  	defer m.Unlock()
  
  	// Nothing to do if the miner is not currently running or if running in
  	// discrete mode (using GenerateNBlocks).
  	if !m.started || m.discreteMining {
  		return
  	}
  
  	close(m.quit)
  	m.wg.Wait()
  	m.started = false
  	log.Infof("CPU miner stopped")
  }
docs: // Stop gracefully stops the mining process by signalling all workers, and the
  // speed monitor to quit.  Calling this function when the CPU miner has not
  // already been started will have no effect.
  //
  // This function is safe for concurrent access.