}
defer func() {
for _, peer := range peersForPiece {
- if peer.canRequestPiece(p.index) {
- peer.requestablePiecesRemaining--
- }
+ peer.requestablePiecesRemaining--
}
peersForPiecesPool.Put(peersForPiece)
}()
if !peer.canFitRequest() {
continue
}
- if !peer.canRequestPiece(p.index) {
- continue
- }
preallocated[spec] = append(preallocated[spec], peer)
peer.addNextRequest(req)
}
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
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