// TODO: This might be used in more places I think.
func (p *Peer) canRequestPiece(i pieceIndex) bool {
- return p.HasPiece(i) && (!p.Choking || (p.PieceAllowedFast != nil && p.PieceAllowedFast(i)))
+ return (!p.Choking || p.pieceAllowedFastOrDefault(i)) && p.HasPiece(i)
}