code: func (cl *Client) newTorrent(ih metainfo.Hash, specStorage storage.ClientImpl) (t *Torrent) {
  	// use provided storage, if provided
  	storageClient := cl.defaultStorage
  	if specStorage != nil {
  		storageClient = storage.NewClient(specStorage)
  	}
  
  	t = &Torrent{
  		cl:       cl,
  		infoHash: ih,
  		peers: prioritizedPeers{
  			om: btree.New(32),
  			getPrio: func(p Peer) peerPriority {
  				return bep40PriorityIgnoreError(cl.publicAddr(p.IP), p.addr())
  			},
  		},
  		conns: make(map[*connection]struct{}, 2*cl.config.EstablishedConnsPerTorrent),
  
  		halfOpen:          make(map[string]Peer),
  		pieceStateChanges: pubsub.NewPubSub(),
  
  		storageOpener:       storageClient,
  		maxEstablishedConns: cl.config.EstablishedConnsPerTorrent,
  
  		networkingEnabled: true,
  		requestStrategy:   2,
  		metadataChanged: sync.Cond{
  			L: cl.locker(),
  		},
  		duplicateRequestTimeout: 1 * time.Second,
  	}
  	t.logger = cl.logger.Clone().AddValue(t)
  	t.setChunkSize(defaultChunkSize)
  	return
  }
docs: // Return a Torrent ready for insertion into a Client.