]> Sergey Matveev's repositories - btrtrc.git/blobdiff - requesting.go
Fix request heap pop bug
[btrtrc.git] / requesting.go
index 46796bd29d772f9db793991a2bb4f74373986d3f..8b9db971b537630e65dd41ca9618f8a708f6a698 100644 (file)
@@ -265,7 +265,7 @@ func (p *Peer) applyRequestState(next desiredRequestState) {
                        originalRequestCount, p.needRequestUpdate))
        }
        for requestHeap.Len() != 0 && maxRequests(current.Requests.GetCardinality()+current.Cancelled.GetCardinality()) < p.nominalMaxRequests() {
-               req := requestHeap.Pop()
+               req := heap.Pop(requestHeap)
                existing := t.requestingPeer(req)
                if existing != nil && existing != p {
                        // Don't steal from the poor.