saving node information while heartbeating
This commit is contained in:
		
							parent
							
								
									f67146aa13
								
							
						
					
					
						commit
						ad9c445fe5
					
				| @ -55,7 +55,9 @@ pub async fn heartbeat( | ||||
|         state.remove_inactive_nodes().await; | ||||
|         let connected_ips = state.get_connected_ips().await; | ||||
|         println!("Connected nodes ({}): {:?}", connected_ips.len(), connected_ips); | ||||
|         let _ = tx.send((state.get_my_ip().await, state.get_my_info().await).into()); | ||||
|         let my_node_info = state.get_my_info().await; | ||||
|         my_node_info.save(); | ||||
|         let _ = tx.send((state.get_my_ip().await, my_node_info).into()); | ||||
|         if connected_ips.len() < NUM_CONNECTIONS { | ||||
|             if let Some(node_ip) = state.get_random_disconnected_ip().await { | ||||
|                 println!("Dialing random node {}", node_ip); | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user