From a671c06b94fa5743411cd0d257aa8ae759321367 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 13 Dec 2021 11:55:47 +1100 Subject: [PATCH] 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. --- torrent.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.44.0