*Handle available only having 1 item
This commit is contained in:
parent
7a12d7e4cd
commit
1090b203dc
|
@ -141,7 +141,11 @@ export default class DHT {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
const relayIndex = await randomNumber(0, available.length - 1);
|
let relayIndex = 0;
|
||||||
|
|
||||||
|
if (available.length > 1) {
|
||||||
|
relayIndex = await randomNumber(0, available.length - 1);
|
||||||
|
}
|
||||||
|
|
||||||
const connection = this._relays.get(available[relayIndex]) as string;
|
const connection = this._relays.get(available[relayIndex]) as string;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue