remove 2nd param from Math.floor, refreshSendingSwarm fix refreshSwarmNodesForPubKey pubkey

pull/1061/head
Ryan Tharp 5 years ago
parent 078e95f8c9
commit 2be1a0850c

@ -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);

Loading…
Cancel
Save