code: func (m *CPUMiner) submitBlock(block *btcutil.Block) bool {
  	m.submitBlockLock.Lock()
  	defer m.submitBlockLock.Unlock()
  
  	// Ensure the block is not stale since a new block could have shown up
  	// while the solution was being found.  Typically that condition is
  	// detected and all work on the stale block is halted to start work on
  	// a new block, but the check only happens periodically, so it is
  	// possible a block was found and submitted in between.
  	msgBlock := block.MsgBlock()
  	if !msgBlock.Header.PrevBlock.IsEqual(&m.g.BestSnapshot().Hash) {
  		log.Debugf("Block submitted via CPU miner with previous "+
  			"block %s is stale", msgBlock.Header.PrevBlock)
  		return false
  	}
  
  	// Process this block using the same rules as blocks coming from other
  	// nodes.  This will in turn relay it to the network like normal.
  	isOrphan, err := m.cfg.ProcessBlock(block, blockchain.BFNone)
  	if err != nil {
  		// Anything other than a rule violation is an unexpected error,
  		// so log that error as an internal error.
  		if _, ok := err.(blockchain.RuleError); !ok {
  			log.Errorf("Unexpected error while processing "+
  				"block submitted via CPU miner: %v", err)
  			return false
  		}
  
  		log.Debugf("Block submitted via CPU miner rejected: %v", err)
  		return false
  	}
  	if isOrphan {
  		log.Debugf("Block submitted via CPU miner is an orphan")
  		return false
  	}
  
  	// The block was accepted.
  	coinbaseTx := block.MsgBlock().Transactions[0].TxOut[0]
  	log.Infof("Block submitted via CPU miner accepted (hash %s, "+
  		"amount %v)", block.Hash(), btcutil.Amount(coinbaseTx.Value))
  	return true
  }
docs: // submitBlock submits the passed block to network after ensuring it passes all
  // of the consensus validation rules.