diff --git a/src/gui/views/network/connections.rs b/src/gui/views/network/connections.rs index 96316132..57aa8bbf 100644 --- a/src/gui/views/network/connections.rs +++ b/src/gui/views/network/connections.rs @@ -175,7 +175,7 @@ impl ConnectionsContent { let status_text = format!("{} {}", status_icon, if has_error { t!("error").into() } else { - Node::get_sync_status_text().into() + Node::get_sync_status_text() }); View::ellipsize_text(ui, status_text, 15.0, Colors::text(false)); ui.add_space(1.0); diff --git a/src/node/node.rs b/src/node/node.rs index f8121707..f3c7bbe7 100644 --- a/src/node/node.rs +++ b/src/node/node.rs @@ -456,28 +456,28 @@ impl Node { } /// Get synchronization status i18n text. - pub fn get_sync_status_text() -> impl Into { + pub fn get_sync_status_text() -> String { if Node::data_dir_changing() { - return t!("moving_files"); + return t!("moving_files").into(); } if Node::is_stopping() { - return t!("sync_status.shutdown"); + return t!("sync_status.shutdown").into(); }; if Node::is_starting() { - return t!("sync_status.initial"); + return t!("sync_status.initial").into(); }; if Node::is_restarting() { - return t!("sync_status.node_restarting"); + return t!("sync_status.node_restarting").into(); } let sync_status = Self::get_sync_status(); if sync_status.is_none() { - return t!("sync_status.node_down"); + return t!("sync_status.node_down").into(); } - match sync_status.unwrap() { + let sync_status = match sync_status.unwrap() { SyncStatus::Initial => t!("sync_status.initial"), SyncStatus::NoSync => t!("sync_status.no_sync"), SyncStatus::AwaitingPeers(_) => t!("sync_status.awaiting_peers"), @@ -573,7 +573,8 @@ impl Node { } } SyncStatus::Shutdown => t!("sync_status.shutdown"), - } + }; + sync_status.into() } } @@ -696,14 +697,14 @@ pub fn start_stratum_mining_server(server: &Server, config: StratumServerConfig) stop_state.reset(); let server_state = stop_state.clone(); thread::spawn(move || { - stratum_server.run_loop(proof_size, sync_state, stop_state); - server_state.reset(); - // Reset stratum stats. - { - let mut w_stratum_stats = NODE_STATE.stratum_stats.write(); - *w_stratum_stats = StratumStats::default(); - } - }); + stratum_server.run_loop(proof_size, sync_state, stop_state); + server_state.reset(); + // Reset stratum stats. + { + let mut w_stratum_stats = NODE_STATE.stratum_stats.write(); + *w_stratum_stats = StratumStats::default(); + } + }); } #[allow(dead_code)]