Persisting nodeinfo #5

Merged
valy merged 1 commits from noormohammedb/hacker-challenge-sgx-general:patch_node_info_persistance into main 2025-01-06 16:17:20 +00:00
Showing only changes of commit ad9c445fe5 - Show all commits

@ -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);