]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Torrent.bytesLeft was taking a copy instead of pointer to Piece
authorMatt Joiner <anacrolix@gmail.com>
Fri, 1 Dec 2017 06:58:42 +0000 (17:58 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Fri, 1 Dec 2017 06:58:42 +0000 (17:58 +1100)
torrent.go

index 95e972616bfbb23c7527b82eec4bfe17766bdea7..365c9f86bd3f15c827efa73a1a59aa20a451a164 100644 (file)
@@ -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
        })