From a6759b321a75380d21421803fb9b607e48636e42 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 15 Feb 2016 17:47:04 +1100 Subject: [PATCH] Only assert we should be requesting a piece in debug mode --- connection.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/connection.go b/connection.go index 85f99e79..cb2fbf29 100644 --- a/connection.go +++ b/connection.go @@ -572,6 +572,9 @@ func (c *connection) updateRequests() { func (c *connection) fillRequests() { c.pieceRequestOrder.IterTyped(func(piece int) (more bool) { + if c.t.cl.config.Debug && c.t.havePiece(piece) { + panic(piece) + } return c.requestPiecePendingChunks(piece) }) }