]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Fix failure to request data from peers if it goes missing after being downloaded...
authorMatt Joiner <anacrolix@gmail.com>
Sun, 21 Feb 2016 16:23:49 +0000 (03:23 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Sun, 21 Feb 2016 16:23:49 +0000 (03:23 +1100)
The chunks remained marked dirty, even after the piece was marked complete. So when the piece was not complete, there was nothing to do.

client.go

index 91ea730e31be02b305c19e91fee46166e5307080..cff3e5624b411b95177115b68a2bd54219a9f6c6 100644 (file)
--- a/client.go
+++ b/client.go
@@ -2435,6 +2435,7 @@ func (me *Client) pieceHashed(t *torrent, piece int, correct bool) {
 
 func (me *Client) onCompletedPiece(t *torrent, piece int) {
        t.pendingPieces.Remove(piece)
+       t.pendAllChunkSpecs(piece)
        for _, conn := range t.Conns {
                conn.Have(piece)
                for r := range conn.Requests {