Only assert pending requests when check is enabled

Uses too much CPU for production from its current callsites.
This commit is contained in:
Matt Joiner 2021-10-26 14:42:42 +11:00
parent 344ada8b7c
commit 98957b6e8e
1 changed files with 3 additions and 0 deletions

View File

@ -1408,6 +1408,9 @@ func (t *Torrent) numActivePeers() (num int) {
}
func (t *Torrent) assertPendingRequests() {
if !check {
return
}
var actual pendingRequests
if t.haveInfo() {
actual.m = make([]int, t.numRequests())