Add explanation to peer semaphore

This commit is contained in:
Igor Katson 2024-05-02 09:04:57 +01:00
parent 04d8b5f7c8
commit 648c4edf71
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5

View file

@ -1277,7 +1277,9 @@ impl PeerHandler {
trace!("we are unchoked");
self.locked.write().i_am_choked = false;
self.unchoke_notify.notify_waiters();
// TODO: compute this better than hard coding.
// 128 should be more than enough to maintain 100mbps
// for a single peer that has 100ms ping
// https://www.desmos.com/calculator/x3szur87ps
self.requests_sem.add_permits(128);
}