|  |  | @ -92,10 +92,10 @@ class LokiSnodeAPI { | 
			
		
	
		
		
			
				
					
					|  |  |  |       ); |  |  |  |       ); | 
			
		
	
		
		
			
				
					
					|  |  |  |       // Filter 0.0.0.0 nodes which haven't submitted uptime proofs
 |  |  |  |       // Filter 0.0.0.0 nodes which haven't submitted uptime proofs
 | 
			
		
	
		
		
			
				
					
					|  |  |  |       const snodes = result.result.service_node_states.filter( |  |  |  |       const snodes = result.result.service_node_states.filter( | 
			
		
	
		
		
			
				
					
					|  |  |  |         snode => snode.address !== '0.0.0.0' |  |  |  |         snode => snode.public_ip !== '0.0.0.0' | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |       ); |  |  |  |       ); | 
			
		
	
		
		
			
				
					
					|  |  |  |       this.randomSnodePool = snodes.map(snode => ({ |  |  |  |       this.randomSnodePool = snodes.map(snode => ({ | 
			
		
	
		
		
			
				
					
					|  |  |  |         address: snode.public_ip, |  |  |  |         ip: snode.public_ip, | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         port: snode.storage_port, |  |  |  |         port: snode.storage_port, | 
			
		
	
		
		
			
				
					
					|  |  |  |       })); |  |  |  |       })); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } catch (e) { |  |  |  |     } catch (e) { | 
			
		
	
	
		
		
			
				
					|  |  | @ -162,21 +162,17 @@ class LokiSnodeAPI { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   async getSwarmNodes(pubKey) { |  |  |  |   async getSwarmNodes(pubKey) { | 
			
		
	
		
		
			
				
					
					|  |  |  |     // TODO: Hit multiple random nodes and merge lists?
 |  |  |  |     // TODO: Hit multiple random nodes and merge lists?
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     const { address, port } = await this.getRandomSnodeAddress(); |  |  |  |     const { ip, port } = await this.getRandomSnodeAddress(); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     try { |  |  |  |     try { | 
			
		
	
		
		
			
				
					
					|  |  |  |       const result = await rpc( |  |  |  |       const result = await rpc(`https://${ip}`, port, 'get_snodes_for_pubkey', { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         `https://${address}`, |  |  |  |         pubKey, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         port, |  |  |  |       }); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         'get_snodes_for_pubkey', |  |  |  |       const snodes = result.snodes.filter(snode => snode.ip !== '0.0.0.0'); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         { |  |  |  |       return snodes; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |           pubKey, |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |       ); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |       return result.snodes; |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     } catch (e) { |  |  |  |     } catch (e) { | 
			
		
	
		
		
			
				
					
					|  |  |  |       this.randomSnodePool = _.without( |  |  |  |       this.randomSnodePool = _.without( | 
			
		
	
		
		
			
				
					
					|  |  |  |         this.randomSnodePool, |  |  |  |         this.randomSnodePool, | 
			
		
	
		
		
			
				
					
					|  |  |  |         _.find(this.randomSnodePool, { address }) |  |  |  |         _.find(this.randomSnodePool, { ip }) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |       ); |  |  |  |       ); | 
			
		
	
		
		
			
				
					
					|  |  |  |       return this.getSwarmNodes(pubKey); |  |  |  |       return this.getSwarmNodes(pubKey); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |