From: Matt Joiner Date: Fri, 29 Jan 2021 05:14:08 +0000 (+1100) Subject: We're not expecting chunks if we have no outstanding requests X-Git-Tag: v1.22.0~1 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=68d8604c2090ec24b3cc80b0fc933486fadb5a0c;p=btrtrc.git We're not expecting chunks if we have no outstanding requests --- diff --git a/peerconn.go b/peerconn.go index 1b585233..cf9ace9d 100644 --- a/peerconn.go +++ b/peerconn.go @@ -167,7 +167,7 @@ func (cn *Peer) updateExpectingChunks() { } func (cn *Peer) expectingChunks() bool { - return cn.interested && !cn.peerChoking + return len(cn.requests) != 0 && !cn.peerChoking } // Returns true if the connection is over IPv6.