From: Matt Joiner Date: Fri, 1 Dec 2017 06:58:42 +0000 (+1100) Subject: Torrent.bytesLeft was taking a copy instead of pointer to Piece X-Git-Tag: v1.0.0~326 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=afa9d2ba287d0cdb2dd506217ec5399577e6dbb1;p=btrtrc.git Torrent.bytesLeft was taking a copy instead of pointer to Piece --- diff --git a/torrent.go b/torrent.go index 95e97261..365c9f86 100644 --- a/torrent.go +++ b/torrent.go @@ -570,7 +570,7 @@ func (t *Torrent) bytesMissingLocked() int64 { func (t *Torrent) bytesLeft() (left int64) { bitmap.Flip(t.completedPieces, 0, t.numPieces()).IterTyped(func(piece int) bool { - p := t.pieces[piece] + p := &t.pieces[piece] left += int64(p.length() - p.numDirtyBytes()) return true })