request-strategy/order.go | 13 +------------ diff --git a/request-strategy/order.go b/request-strategy/order.go index 9b81a94858fcfed2c7b6133f83ce8a1807e4ea6d..8b4b67998d691fc506410d9fad4d17af4c26faa3 100644 --- a/request-strategy/order.go +++ b/request-strategy/order.go @@ -311,9 +311,7 @@ }) } defer func() { for _, peer := range peersForPiece { - if peer.canRequestPiece(p.index) { - peer.requestablePiecesRemaining-- - } + peer.requestablePiecesRemaining-- } peersForPiecesPool.Put(peersForPiece) }() @@ -336,9 +334,6 @@ if h := peer.HasExistingRequest; h == nil || !h(req) { continue } if !peer.canFitRequest() { - continue - } - if !peer.canRequestPiece(p.index) { continue } preallocated[spec] = append(preallocated[spec], peer) @@ -357,9 +352,6 @@ for _, peer := range peersForPiece { if !peer.canFitRequest() { continue } - if !peer.HasPiece(p.index) { - continue - } if !peer.pieceAllowedFastOrDefault(p.index) { // TODO: Verify that's okay to stay uninterested if we request allowed fast pieces. peer.nextState.Interested = true @@ -384,9 +376,6 @@ delete(pp.nextState.Requests, req) } for _, peer := range peersForPiece { if !peer.canFitRequest() { - continue - } - if !peer.HasPiece(p.index) { continue } if !peer.pieceAllowedFastOrDefault(p.index) {