From afa9d2ba287d0cdb2dd506217ec5399577e6dbb1 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Fri, 1 Dec 2017 17:58:42 +1100 Subject: [PATCH] Torrent.bytesLeft was taking a copy instead of pointer to Piece --- torrent.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 }) -- 2.48.1