From: Matt Joiner Date: Sun, 28 Nov 2021 11:36:19 +0000 (+1100) Subject: Peers with all pieces have wanted pieces only if we want any piece X-Git-Tag: v1.39.0~42 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=51f6f07633b3e78cd500dae71de4179179c5614c;p=btrtrc.git Peers with all pieces have wanted pieces only if we want any piece --- diff --git a/peerconn.go b/peerconn.go index 06469461..003e32c5 100644 --- a/peerconn.go +++ b/peerconn.go @@ -1525,7 +1525,7 @@ func (cn *Peer) netGoodPiecesDirtied() int64 { func (c *Peer) peerHasWantedPieces() bool { if all, _ := c.peerHasAllPieces(); all { - return !c.t.haveAllPieces() + return !c.t.haveAllPieces() && !c.t._pendingPieces.IsEmpty() } if !c.t.haveInfo() { return !c.peerPieces().IsEmpty()