]> Sergey Matveev's repositories - btrtrc.git/commitdiff
We're not expecting chunks if we have no outstanding requests
authorMatt Joiner <anacrolix@gmail.com>
Fri, 29 Jan 2021 05:14:08 +0000 (16:14 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Fri, 29 Jan 2021 05:14:08 +0000 (16:14 +1100)
peerconn.go

index 1b585233eb8b6b982abf26659c40469cca4a36f0..cf9ace9ddd31c72dda109d60a9f1248c1eb89dd2 100644 (file)
@@ -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.