func (t *Torrent) onIncompletePiece(piece pieceIndex) {
	if t.pieceAllDirty(piece) {
		t.pendAllChunkSpecs(piece)
	}
	if !t.wantPieceIndex(piece) {
		// t.logger.Printf("piece %d incomplete and unwanted", piece)
		return
	}
	// We could drop any connections that we told we have a piece that we
	// don't here. But there's a test failure, and it seems clients don't care
	// if you request pieces that you already claim to have. Pruning bad
	// connections might just remove any connections that aren't treating us
	// favourably anyway.

	// for c := range t.conns {
	// 	if c.sentHave(piece) {
	// 		c.drop()
	// 	}
	// }
	for conn := range t.conns {
		if conn.peerHasPiece(piece) {
			conn.updateRequests()
		}
	}
}
// Called when a piece is found to be not complete.
Called when a piece is found to be not complete.
// Called when a piece is found to be not complete .
func (t *Torrent) onIncompletePiece(piece pieceIndex) {
	if t.pieceAllDirty(piece) {
		t.pendAllChunkSpecs(piece)
	}
	if !t.wantPieceIndex(piece) {
		return
	}
	for conn := range t.conns {
		if conn.peerHasPiece(piece) {
			conn.updateRequests()
		}
	}
}
func ( t * Torrent ) onIncompletePiece ( piece pieceIndex ) { if t . pieceAllDirty ( piece ) { t . pendAllChunkSpecs ( piece ) } if ! t . wantPieceIndex ( piece ) { return } for conn := range t . conns { if conn . peerHasPiece ( piece ) { conn . updateRequests ( ) } } }
Called when a piece is found to be not complete.
Called when a piece is found to be not complete .
// t.logger.Printf("piece %d incomplete and unwanted", piece) // We could drop any connections that we told we have a piece that we // don't here. But there's a test failure, and it seems clients don't care // if you request pieces that you already claim to have. Pruning bad // connections might just remove any connections that aren't treating us // favourably anyway. // for c := range t.conns { // 	if c.sentHave(piece) { // 		c.drop() // 	} // }