]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Add doc comment for Torrent.BytesMissing
authorMatt Joiner <anacrolix@gmail.com>
Fri, 19 May 2023 04:18:24 +0000 (14:18 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Fri, 19 May 2023 04:18:24 +0000 (14:18 +1000)
Fixes https://github.com/anacrolix/torrent/issues/828.

torrent.go

index 5184fc795971f6aa3987db55f51ce37ab439ab53..315f707236495a7a0834c8a520e643dd68e9846a 100644 (file)
@@ -830,7 +830,10 @@ func (t *Torrent) newMetaInfo() metainfo.MetaInfo {
        }
 }
 
-// Get bytes left
+// Returns a count of bytes that are not complete in storage, and not pending being written to
+// storage. This value is from the perspective of the download manager, and may not agree with the
+// actual state in storage. If you want read data synchronously you should use a Reader. See
+// https://github.com/anacrolix/torrent/issues/828.
 func (t *Torrent) BytesMissing() (n int64) {
        t.cl.rLock()
        n = t.bytesMissingLocked()