]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Peers with all pieces have wanted pieces only if we want any piece
authorMatt Joiner <anacrolix@gmail.com>
Sun, 28 Nov 2021 11:36:19 +0000 (22:36 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Sun, 28 Nov 2021 11:36:19 +0000 (22:36 +1100)
peerconn.go

index 0646946174a5c1603352d7d500b850782a852401..003e32c57821fd135613ca370219170bb3828405 100644 (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()