}
t.smartBanCache.Init()
t.networkingEnabled.Set()
- t.logger = cl.logger.WithDefaultLevel(log.Debug)
+ t.logger = cl.logger.WithDefaultLevel(log.Debug).WithNames(t.InfoHash().HexString())
t.sourcesLogger = t.logger.WithNames("sources")
if opts.ChunkSize == 0 {
opts.ChunkSize = defaultChunkSize
"github.com/anacrolix/torrent/metainfo"
)
-// The Torrent's infohash. This is fixed and cannot change. It uniquely identifies a torrent.
+// The Torrent's infohash. This is fixed and cannot change. It uniquely
+// identifies a torrent. TODO: If this doesn't change, should we stick to
+// referring to a Torrent by the original infohash given to us?
func (t *Torrent) InfoHash() metainfo.Hash {
return *t.canonicalShortInfohash()
}