2
0
mirror of synced 2025-02-24 06:38:14 +00:00

Only assert we should be requesting a piece in debug mode

This commit is contained in:
Matt Joiner 2016-02-15 17:47:04 +11:00
parent a17e31794c
commit a6759b321a

View File

@ -572,6 +572,9 @@ func (c *connection) updateRequests() {
func (c *connection) fillRequests() { func (c *connection) fillRequests() {
c.pieceRequestOrder.IterTyped(func(piece int) (more bool) { c.pieceRequestOrder.IterTyped(func(piece int) (more bool) {
if c.t.cl.config.Debug && c.t.havePiece(piece) {
panic(piece)
}
return c.requestPiecePendingChunks(piece) return c.requestPiecePendingChunks(piece)
}) })
} }