]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Still update a connections piece priority even if the peer doesn't have the piece
authorMatt Joiner <anacrolix@gmail.com>
Tue, 9 Feb 2016 13:47:53 +0000 (00:47 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Tue, 9 Feb 2016 13:47:53 +0000 (00:47 +1100)
connection.go

index a140e24c7a50847b7ff4199fc7023ce403b8e657..85f99e79c9158518b0e106d993d88c9d071b642c 100644 (file)
@@ -585,10 +585,10 @@ func (c *connection) stopRequestingPiece(piece int) {
 }
 
 func (c *connection) updatePiecePriority(piece int) {
+       tpp := c.t.piecePriority(piece)
        if !c.PeerHasPiece(piece) {
-               return
+               tpp = PiecePriorityNone
        }
-       tpp := c.t.piecePriority(piece)
        if tpp == PiecePriorityNone {
                c.stopRequestingPiece(piece)
                return