From: Matt Joiner Date: Mon, 15 Feb 2016 06:47:04 +0000 (+1100) Subject: Only assert we should be requesting a piece in debug mode X-Git-Tag: v1.0.0~892 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=a6759b321a75380d21421803fb9b607e48636e42;p=btrtrc.git Only assert we should be requesting a piece in debug mode --- 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) }) }