*only use RNG if we have more than 1 relay available
This commit is contained in:
parent
929b64cc1d
commit
5073788529
|
@ -41,7 +41,8 @@ export default class HyperswarmWeb extends EventEmitter {
|
||||||
const relays = this.relays;
|
const relays = this.relays;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
const index = await randomNumber(0, relays.length - 1);
|
const index =
|
||||||
|
relays.length > 1 ? await randomNumber(0, relays.length - 1) : 0;
|
||||||
const relay = relays[index];
|
const relay = relays[index];
|
||||||
|
|
||||||
let ret;
|
let ret;
|
||||||
|
|
Loading…
Reference in New Issue