diff --git a/js/modules/loki_snode_api.js b/js/modules/loki_snode_api.js index ba50946ac..65d7a7e8c 100644 --- a/js/modules/loki_snode_api.js +++ b/js/modules/loki_snode_api.js @@ -95,7 +95,7 @@ class LokiSnodeAPI { snode => snode.public_ip !== '0.0.0.0' ); this.randomSnodePool = snodes.map(snode => ({ - address: snode.public_ip, + ip: snode.public_ip, port: snode.storage_port, })); } catch (e) { @@ -162,22 +162,17 @@ class LokiSnodeAPI { async getSwarmNodes(pubKey) { // TODO: Hit multiple random nodes and merge lists? - const { address, port } = await this.getRandomSnodeAddress(); + const { ip, port } = await this.getRandomSnodeAddress(); try { - const result = await rpc( - `https://${address}`, - port, - 'get_snodes_for_pubkey', - { - pubKey, - } - ); + const result = await rpc(`https://${ip}`, port, 'get_snodes_for_pubkey', { + pubKey, + }); const snodes = result.snodes.filter(snode => snode.ip !== '0.0.0.0'); return snodes; } catch (e) { this.randomSnodePool = _.without( this.randomSnodePool, - _.find(this.randomSnodePool, { address }) + _.find(this.randomSnodePool, { ip }) ); return this.getSwarmNodes(pubKey); }