t.go | 8 +++----- diff --git a/t.go b/t.go index 31515c53090235120c7348cab5a7e1d8be6a1024..eb292c915f0cd7de3b0443dfbf51fb594a4fdafe 100644 --- a/t.go +++ b/t.go @@ -104,12 +104,10 @@ // The completed length of all the torrent data, in all its files. This is // derived from the torrent info, when it is available. func (t *Torrent) Length() int64 { - select { - case <-t.GotInfo(): - return t.length - default: - return -1 + if t.info == nil { + panic("not valid until info obtained") } + return t.length } // Returns a run-time generated metainfo for the torrent that includes the