code: func (cl *Client) receiveHandshakes(c *connection) (t *Torrent, err error) {
  	defer perf.ScopeTimerErr(&err)()
  	var rw io.ReadWriter
  	rw, c.headerEncrypted, c.cryptoMethod, err = handleEncryption(c.rw(), cl.forSkeys, cl.config.EncryptionPolicy)
  	c.setRW(rw)
  	if err == nil || err == mse.ErrNoSecretKeyMatch {
  		if c.headerEncrypted {
  			torrent.Add("handshakes received encrypted", 1)
  		} else {
  			torrent.Add("handshakes received unencrypted", 1)
  		}
  	} else {
  		torrent.Add("handshakes received with error while handling encryption", 1)
  	}
  	if err != nil {
  		if err == mse.ErrNoSecretKeyMatch {
  			err = nil
  		}
  		return
  	}
  	if cl.config.ForceEncryption && !c.headerEncrypted {
  		err = errors.New("connection not encrypted")
  		return
  	}
  	ih, ok, err := cl.connBTHandshake(c, nil)
  	if err != nil {
  		err = fmt.Errorf("error during bt handshake: %s", err)
  		return
  	}
  	if !ok {
  		return
  	}
  	cl.lock()
  	t = cl.torrents[ih]
  	cl.unlock()
  	return
  }
docs: // Do encryption and bittorrent handshakes as receiver.