From: Matt Joiner Date: Mon, 13 Dec 2021 00:55:47 +0000 (+1100) Subject: Update peer requests if not interested when piece priorities change X-Git-Tag: v1.39.1~4 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=a671c06b94fa5743411cd0d257aa8ae759321367;p=btrtrc.git Update peer requests if not interested when piece priorities change This should fix a starvation issue where we don't signal interest to a peer that has us choked. --- diff --git a/torrent.go b/torrent.go index 508de54c..c41b213b 100644 --- a/torrent.go +++ b/torrent.go @@ -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)