From: Matt Joiner Date: Fri, 19 May 2023 04:18:24 +0000 (+1000) Subject: Add doc comment for Torrent.BytesMissing X-Git-Tag: v1.51.1~3 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=56c8b396f50fd2603fcefed128ba72e13e2961ef;p=btrtrc.git Add doc comment for Torrent.BytesMissing Fixes https://github.com/anacrolix/torrent/issues/828. --- diff --git a/torrent.go b/torrent.go index 5184fc79..315f7072 100644 --- a/torrent.go +++ b/torrent.go @@ -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()