]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Ensure piece completion state is correct at startup
authorMatt Joiner <anacrolix@gmail.com>
Wed, 17 Feb 2016 06:20:21 +0000 (17:20 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Wed, 17 Feb 2016 06:20:21 +0000 (17:20 +1100)
torrent.go

index 589bff887ba6b9406cbe6e58e00295365e67e33f..6e726a6eceb57dff784b836098906ad02d45ffd8 100644 (file)
@@ -276,8 +276,8 @@ func (t *torrent) setStorage(td Data) {
                t.data.Close()
        }
        t.data = td
-       t.completedPieces.Clear()
        for i := range t.Pieces {
+               t.updatePieceCompletion(i)
                t.Pieces[i].QueuedForHash = true
        }
        go func() {