From 2be1a0850c190cd7a0e503afda684bd618b9f3ec Mon Sep 17 00:00:00 2001 From: Ryan Tharp Date: Thu, 16 Apr 2020 16:27:18 -0700 Subject: [PATCH] remove 2nd param from Math.floor, refreshSendingSwarm fix refreshSwarmNodesForPubKey pubkey --- js/modules/loki_message_api.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/modules/loki_message_api.js b/js/modules/loki_message_api.js index 3790e2c39..22208663d 100644 --- a/js/modules/loki_message_api.js +++ b/js/modules/loki_message_api.js @@ -138,9 +138,7 @@ class LokiMessageAPI { } async refreshSendingSwarm(pubKey, timestamp) { - const freshNodes = await lokiSnodeAPI.refreshSwarmNodesForPubKey( - this.ourKey - ); + const freshNodes = await lokiSnodeAPI.refreshSwarmNodesForPubKey(pubKey); this.sendingData[timestamp].swarm = freshNodes; this.sendingData[timestamp].hasFreshList = true; return true; @@ -434,8 +432,11 @@ class LokiMessageAPI { this.ourKey ); + // ok now split up our swarm pool into numConnections number of pools + // one for each retrieve connection + // floor or ceil probably doesn't matter, since it's likely always uneven - const poolSize = Math.floor(nodes.length / numConnections, 10); + const poolSize = Math.floor(nodes.length / numConnections); const pools = []; while (nodes.length) { const poolList = nodes.splice(0, poolSize);