]> Sergey Matveev's repositories - btrtrc.git/blob - peer.go
Use webrtc local addr for webrtc conn peer priority
[btrtrc.git] / peer.go
1 package torrent
2
3 type peerLocalPublicAddr = IpPort
4
5 func (p *Peer) isLowOnRequests() bool {
6         return p.requestState.Requests.IsEmpty() && p.requestState.Cancelled.IsEmpty()
7 }
8
9 func (p *Peer) decPeakRequests() {
10         // // This can occur when peak requests are altered by the update request timer to be lower than
11         // // the actual number of outstanding requests. Let's let it go negative and see what happens. I
12         // // wonder what happens if maxRequests is not signed.
13         // if p.peakRequests < 1 {
14         //      panic(p.peakRequests)
15         // }
16         p.peakRequests--
17 }