]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Filter update requests on piece priority change by peer choking and allowed fast
authorMatt Joiner <anacrolix@gmail.com>
Tue, 30 Nov 2021 04:19:59 +0000 (15:19 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Sun, 12 Dec 2021 04:01:50 +0000 (15:01 +1100)
torrent.go

index dfc56a325dd37cca775ec88c1960fe7ca50f168d..7ccf13f680444b8fea5ba1d0a77813b1eb4e6aaf 100644 (file)
@@ -1091,6 +1091,9 @@ func (t *Torrent) piecePriorityChanged(piece pieceIndex, reason string) {
                        if !c.peerHasPiece(piece) {
                                return
                        }
+                       if c.peerChoking && !c.peerAllowedFast.Contains(uint32(piece)) {
+                               return
+                       }
                        c.updateRequests(reason)
                })
        }