peerconn.go | 3 +++ diff --git a/peerconn.go b/peerconn.go index 4aee30fdbf557f712f5e2fa08c3d51a46a4e92b8..2174b0f620e677c68812abd010b95b3a711b68e4 100644 --- a/peerconn.go +++ b/peerconn.go @@ -563,6 +563,9 @@ } if cn.t.pieceQueuedForHash(pieceIndex(r.Index)) { panic("piece is queued for hash") } + if cn.peerChoking && !cn.peerAllowedFast.Contains(bitmap.BitIndex(r.Index)) { + panic("peer choking and piece not allowed fast") + } return nil }