code: func (t *Torrent) worstBadConn() *connection {
  	wcs := worseConnSlice{t.unclosedConnsAsSlice()}
  	heap.Init(&wcs)
  	for wcs.Len() != 0 {
  		c := heap.Pop(&wcs).(*connection)
  		if c.stats.ChunksReadWasted.Int64() >= 6 && c.stats.ChunksReadWasted.Int64() > c.stats.ChunksReadUseful.Int64() {
  			return c
  		}
  		// If the connection is in the worst half of the established
  		// connection quota and is older than a minute.
  		if wcs.Len() >= (t.maxEstablishedConns+1)/2 {
  			// Give connections 1 minute to prove themselves.
  			if time.Since(c.completedHandshake) > time.Minute {
  				return c
  			}
  		}
  	}
  	return nil
  }
docs: // The worst connection is one that hasn't been sent, or sent anything useful
  // for the longest. A bad connection is one that usually sends us unwanted
  // pieces, or has been in worser half of the established connections for more
  // than a minute.