From: Matt Joiner Date: Thu, 20 Mar 2014 13:11:49 +0000 (+1100) Subject: Fix requests to other leechers X-Git-Tag: v1.0.0~1767 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=1b2a85600f8433396cb4f57e3bb7e646a552a172;p=btrtrc.git Fix requests to other leechers --- 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