1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-30 19:46:56 +00:00

fix: assertion failure in std::clamp() when called from rechokeDownloads() (#5080)

This commit is contained in:
Charles Kerr 2023-02-27 11:59:00 -06:00 committed by GitHub
parent 238fd96041
commit ac319321b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1832,8 +1832,9 @@ void rechokeDownloads(tr_swarm* s)
}
}
/* don't let the previous section's number tweaking go too far... */
max_peers = std::clamp(max_peers, MinInterestingPeers, s->tor->peerLimit());
// don't let the previous section's number tweaking go too far...
max_peers = std::max(max_peers, MinInterestingPeers);
max_peers = std::min(max_peers, s->tor->peerLimit());
s->max_peers = max_peers;