mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
window.lokiFeatureFlags.onionRequestPaths => onionRequestHops, needPaths => nodesNeededPerPaths
This commit is contained in:
parent
2907f3d154
commit
06e1a0eec3
2 changed files with 8 additions and 6 deletions
|
@ -348,13 +348,15 @@ class LokiSnodeAPI {
|
|||
const guards = _.shuffle(this.guardNodes);
|
||||
|
||||
// Create path for every guard node:
|
||||
const needPaths = window.lokiFeatureFlags.onionRequestPaths - 1;
|
||||
const nodesNeededPerPaths = window.lokiFeatureFlags.onionRequestHops - 1;
|
||||
|
||||
// Each path needs X (needPaths) nodes in addition to the guard node:
|
||||
// Each path needs X (nodesNeededPerPaths) nodes in addition to the guard node:
|
||||
const maxPath = Math.floor(
|
||||
Math.min(
|
||||
guards.length,
|
||||
needPaths ? otherNodes.length / needPaths : otherNodes.length
|
||||
nodesNeededPerPaths
|
||||
? otherNodes.length / nodesNeededPerPaths
|
||||
: otherNodes.length
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -363,8 +365,8 @@ class LokiSnodeAPI {
|
|||
|
||||
for (let i = 0; i < maxPath; i += 1) {
|
||||
const path = [guards[i]];
|
||||
for (let j = 0; j < needPaths; j += 1) {
|
||||
path.push(otherNodes[i * needPaths + j]);
|
||||
for (let j = 0; j < nodesNeededPerPaths; j += 1) {
|
||||
path.push(otherNodes[i * nodesNeededPerPaths + j]);
|
||||
}
|
||||
this.onionPaths.push({ path, bad: false });
|
||||
}
|
||||
|
|
|
@ -415,7 +415,7 @@ window.lokiFeatureFlags = {
|
|||
useSnodeProxy: !process.env.USE_STUBBED_NETWORK,
|
||||
useSealedSender: true,
|
||||
useOnionRequests: true,
|
||||
onionRequestPaths: 1,
|
||||
onionRequestHops: 1,
|
||||
};
|
||||
|
||||
// eslint-disable-next-line no-extend-native,func-names
|
||||
|
|
Loading…
Reference in a new issue