Peers with all pieces have wanted pieces only if we want any piece

This commit is contained in:
Matt Joiner 2021-11-28 22:36:19 +11:00
parent 91e8f3e127
commit 51f6f07633
1 changed files with 1 additions and 1 deletions

View File

@ -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()