client.go | 4 +++- diff --git a/client.go b/client.go index ec3f94dcfa0457dca4c8de1c7b10915d6e0520d2..8760c283944f81b0adc5a5c60846404466e842e1 100644 --- a/client.go +++ b/client.go @@ -2480,7 +2480,9 @@ if !c.PeerHasPiece(pieceIndex) { panic("piece in request order but peer doesn't have it") } if !t.wantPiece(pieceIndex) { - panic("unwanted piece in connection request order") + log.Printf("unwanted piece %d in connection request order\n%s", pieceIndex, c) + c.pieceRequestOrder.DeletePiece(pieceIndex) + continue } piece := t.Pieces[pieceIndex] for _, cs := range piece.shuffledPendingChunkSpecs(t.pieceLength(pieceIndex), pp.Integer(t.chunkSize)) {