From 1b2a85600f8433396cb4f57e3bb7e646a552a172 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Fri, 21 Mar 2014 00:11:49 +1100 Subject: [PATCH] Fix requests to other leechers --- client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client.go b/client.go index 629b708b..1c02c25f 100644 --- a/client.go +++ b/client.go @@ -131,12 +131,12 @@ func (c *Connection) Post(msg encoding.BinaryMarshaler) { // Returns true if more requests can be sent. func (c *Connection) Request(chunk Request) bool { - if !c.PeerPieces[chunk.Index] { - panic("peer doesn't have that piece!") - } if len(c.Requests) >= maxRequests { return false } + if !c.PeerPieces[chunk.Index] { + return true + } c.SetInterested(true) if c.PeerChoked { return false -- 2.48.1