diff --git a/src/gui/views/camera.rs b/src/gui/views/camera.rs index 24303e1a..020040e8 100644 --- a/src/gui/views/camera.rs +++ b/src/gui/views/camera.rs @@ -290,7 +290,7 @@ impl CameraContent { // Launch scanner at separate thread. thread::spawn(move || { - tokio::runtime::Builder::new_multi_thread() + tokio::runtime::Builder::new_current_thread() .enable_all() .build() .unwrap() diff --git a/src/gui/views/wallets/wallet/transport/send.rs b/src/gui/views/wallets/wallet/transport/send.rs index 3babe2b8..69201514 100644 --- a/src/gui/views/wallets/wallet/transport/send.rs +++ b/src/gui/views/wallets/wallet/transport/send.rs @@ -18,11 +18,9 @@ use egui::{Id, RichText}; use grin_core::core::{amount_from_hr_string, amount_to_hr_string}; use grin_wallet_libwallet::{Error, SlatepackAddress}; use parking_lot::RwLock; -use tor_rtcompat::ToplevelBlockOn; -use tor_rtcompat::tokio::TokioNativeTlsRuntime; + use crate::gui::Colors; use crate::gui::platform::PlatformCallbacks; - use crate::gui::views::{CameraContent, Modal, View}; use crate::gui::views::types::TextEditOptions; use crate::gui::views::wallets::wallet::WalletTransactionModal; @@ -311,8 +309,10 @@ impl TransportSendModal { let res = self.send_result.clone(); self.sending = true; thread::spawn(move || { - let runtime = TokioNativeTlsRuntime::create().unwrap(); - runtime + tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .unwrap() .block_on(async { let result = wallet.send_tor(a, &addr).await; let mut w_res = res.write(); diff --git a/src/main.rs b/src/main.rs index 21b4d04b..1b31873b 100755 --- a/src/main.rs +++ b/src/main.rs @@ -14,8 +14,6 @@ #![windows_subsystem = "windows"] -use tor_rtcompat::ToplevelBlockOn; - pub fn main() { #[allow(dead_code)] #[cfg(not(target_os = "android"))] @@ -113,7 +111,6 @@ fn start_desktop_gui(platform: grim::gui::platform::Desktop) { let os = egui::os::OperatingSystem::from_target_os(); let (width, height) = AppConfig::window_size(); let mut viewport = egui::ViewportBuilder::default() - .with_min_inner_size([AppConfig::MIN_WIDTH, AppConfig::MIN_HEIGHT]) .with_inner_size([width, height]); @@ -142,7 +139,6 @@ fn start_desktop_gui(platform: grim::gui::platform::Desktop) { ..Default::default() }; // Use Glow renderer for Windows. - let is_win = os == egui::os::OperatingSystem::Windows; options.renderer = if is_win { eframe::Renderer::Glow } else { @@ -175,9 +171,10 @@ fn start_desktop_gui(platform: grim::gui::platform::Desktop) { #[allow(dead_code)] #[cfg(not(target_os = "android"))] fn is_app_running(data: &Option) -> bool { - use tor_rtcompat::ToplevelBlockOn; - let runtime = tor_rtcompat::tokio::TokioNativeTlsRuntime::create().unwrap(); - let res: Result<(), Box> = runtime + let res: Result<(), Box> = tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .unwrap() .block_on(async { use interprocess::local_socket::{ tokio::{prelude::*, Stream} @@ -214,9 +211,10 @@ fn is_app_running(data: &Option) -> bool { #[cfg(not(target_os = "android"))] fn start_app_socket(platform: grim::gui::platform::Desktop) { std::thread::spawn(move || { - use tor_rtcompat::ToplevelBlockOn; - let runtime = tor_rtcompat::tokio::TokioNativeTlsRuntime::create().unwrap(); - let _: Result<_, _> = runtime + let _ = tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .unwrap() .block_on(async { use interprocess::local_socket::{ tokio::{prelude::*, Stream}, diff --git a/src/wallet/connections/external.rs b/src/wallet/connections/external.rs index 28d1872d..a8da9421 100644 --- a/src/wallet/connections/external.rs +++ b/src/wallet/connections/external.rs @@ -78,7 +78,7 @@ impl ExternalConnection { } } - /// Check external connections availability. + /// Check external connection availability. pub fn check(id: Option, ui_ctx: &egui::Context) { let conn_list = ConnectionsConfig::ext_conn_list(); for conn in conn_list { @@ -99,7 +99,7 @@ fn check_ext_conn(conn: &ExternalConnection, ui_ctx: &egui::Context) { let ui_ctx = ui_ctx.clone(); ConnectionsConfig::update_ext_conn_status(conn.id, None); std::thread::spawn(move || { - tokio::runtime::Builder::new_multi_thread() + tokio::runtime::Builder::new_current_thread() .enable_all() .build() .unwrap()