]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Delete finished pieces from pending
authorMatt Joiner <anacrolix@gmail.com>
Mon, 18 Jan 2016 14:41:53 +0000 (01:41 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 18 Jan 2016 14:41:53 +0000 (01:41 +1100)
client.go

index 32134381f9aead38f579d47510ed0a716b285f97..fe1c6ae4c3b4ea4763f62c4dafa109c68cca72bf 100644 (file)
--- a/client.go
+++ b/client.go
@@ -2496,6 +2496,7 @@ func (me *Client) pieceHashed(t *torrent, piece int, correct bool) {
 }
 
 func (me *Client) onCompletedPiece(t *torrent, piece int) {
+       delete(t.pendingPieces, piece)
        for _, conn := range t.Conns {
                conn.Have(piece)
                for r := range conn.Requests {