handle empty node list before finding disconnected ip
This commit is contained in:
		
							parent
							
								
									01e90f874c
								
							
						
					
					
						commit
						ce69455dd6
					
				| @ -219,7 +219,10 @@ impl State { | ||||
| 
 | ||||
|         let conn_ips = self.get_connected_ips().await; | ||||
|         let nodes = self.nodes.read().await; | ||||
|         let skip = OsRng.next_u64().try_into().unwrap_or(0) % nodes.len(); | ||||
|         if nodes.is_empty() { | ||||
|             return None; | ||||
|         } | ||||
|         let skip = OsRng.next_u64() as usize % nodes.len(); | ||||
|         nodes | ||||
|             .keys() | ||||
|             .map(|ip| ip.to_string()) | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user