Revert "*Store copy of activeRelay size to prevent infinite loop"

This reverts commit 7cb32b716a.
This commit is contained in:
Derrick Hammer 2022-07-26 23:13:30 -04:00
parent 58ba247740
commit cb16b87b73
1 changed files with 1 additions and 4 deletions

View File

@ -130,12 +130,9 @@ export default class DHT {
if (0 === available.length) {
return;
}
const activeRelays = this._activeRelays.size;
while (
this._activeRelays.size <=
Math.min(this._maxConnections, available.length + activeRelays)
Math.min(this._maxConnections, available.length + this._activeRelays.size)
) {
const relayIndex = await randomNumber(0, available.length - 1);