Send to IP

pull/296/head
Beaudan 6 years ago
parent 6b2b9ce926
commit 1f74088586

@ -5,7 +5,7 @@
"contentProxyUrl": "random.snode",
"localServerPort": "8081",
"defaultPoWDifficulty": "100",
"seedNodeUrl": "13.238.53.205",
"seedNodeUrl": "3.104.19.14",
"seedNodePort": "22023",
"disableAutoUpdate": false,
"updatesUrl": "https://updates2.signal.org/desktop",

@ -171,7 +171,8 @@ class LokiMessageAPI {
async openSendConnection(params) {
while (!_.isEmpty(this.sendingSwarmNodes[params.timestamp])) {
const snode = this.sendingSwarmNodes[params.timestamp].shift();
const successfulSend = await this.sendToNode(snode.address, snode.port, params);
// TODO: Revert back to using snode address instead of IP
const successfulSend = await this.sendToNode(snode.ip, snode.port, params);
if (successfulSend) {
return true;
}

@ -84,9 +84,9 @@ class LokiSnodeAPI {
);
const snodes = result.result.service_node_states;
this.randomSnodePool = snodes.map(snode => ({
address: snode.public_ip,
port: snode.storage_port,
})
address: snode.public_ip,
port: snode.storage_port,
})
);
}
@ -108,12 +108,9 @@ class LokiSnodeAPI {
async updateLastHash(nodeUrl, lastHash, expiresAt) {
await window.Signal.Data.updateLastHash({ nodeUrl, lastHash, expiresAt });
if (!this.ourSwarmNodes[nodeUrl]) {
this.ourSwarmNodes[nodeUrl] = {
lastHash,
};
} else {
this.ourSwarmNodes[nodeUrl].lastHash = lastHash;
return;
}
this.ourSwarmNodes[nodeUrl].lastHash = lastHash;
}
getSwarmNodesForPubKey(pubKey) {
@ -146,6 +143,7 @@ class LokiSnodeAPI {
this.ourSwarmNodes[snode.address] = {
lastHash,
port: snode.port,
ip: snode.ip,
};
});
await Promise.all(ps);

Loading…
Cancel
Save