|  |  | @ -348,19 +348,28 @@ class LokiSnodeAPI { | 
			
		
	
		
		
			
				
					
					|  |  |  |     const guards = _.shuffle(this.guardNodes); |  |  |  |     const guards = _.shuffle(this.guardNodes); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     // Create path for every guard node:
 |  |  |  |     // Create path for every guard node:
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     const needPaths = window.lokiFeatureFlags.onionRequestPaths - 1; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     // Each path needs 2 nodes in addition to the guard node:
 |  |  |  |     // Each path needs X (needPaths) nodes in addition to the guard node:
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     const maxPath = Math.floor(Math.min(guards.length, otherNodes.length / 2)); |  |  |  |     const maxPath = Math.floor( | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       Math.min( | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         guards.length, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         needPaths ? otherNodes.length / needPaths : otherNodes.length | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       ) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     // TODO: might want to keep some of the existing paths
 |  |  |  |     // TODO: might want to keep some of the existing paths
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     this.onionPaths = []; |  |  |  |     this.onionPaths = []; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     for (let i = 0; i < maxPath; i += 1) { |  |  |  |     for (let i = 0; i < maxPath; i += 1) { | 
			
		
	
		
		
			
				
					
					|  |  |  |       const path = [guards[i], otherNodes[i * 2], otherNodes[i * 2 + 1]]; |  |  |  |       const path = [guards[i]]; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       for (let j = 0; j < needPaths; j += 1) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         path.push(otherNodes[i * needPaths + j]); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       } | 
			
		
	
		
		
			
				
					
					|  |  |  |       this.onionPaths.push({ path, bad: false }); |  |  |  |       this.onionPaths.push({ path, bad: false }); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     log.info('Built onion paths: ', this.onionPaths); |  |  |  |     log.info(`Built ${this.onionPaths.length} onion paths`, this.onionPaths); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   async getRandomSnodeAddress() { |  |  |  |   async getRandomSnodeAddress() { | 
			
		
	
	
		
		
			
				
					|  |  | 
 |