]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Update peer requests if not interested when piece priorities change
authorMatt Joiner <anacrolix@gmail.com>
Mon, 13 Dec 2021 00:55:47 +0000 (11:55 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 13 Dec 2021 00:55:47 +0000 (11:55 +1100)
This should fix a starvation issue where we don't signal interest to a peer that has us choked.

torrent.go

index 508de54c34ba4654ed7459076b813daa8880fe50..c41b213b21fdc1ee304ae8a7c855b568bf9d0c75 100644 (file)
@@ -1108,7 +1108,7 @@ func (t *Torrent) piecePriorityChanged(piece pieceIndex, reason string) {
                        if !c.peerHasPiece(piece) {
                                return
                        }
-                       if c.peerChoking && !c.peerAllowedFast.Contains(uint32(piece)) {
+                       if c.requestState.Interested && c.peerChoking && !c.peerAllowedFast.Contains(uint32(piece)) {
                                return
                        }
                        c.updateRequests(reason)