diff --git a/applications/tari_app_utilities/src/utilities.rs b/applications/tari_app_utilities/src/utilities.rs index ddc640fd87..d963f212a7 100644 --- a/applications/tari_app_utilities/src/utilities.rs +++ b/applications/tari_app_utilities/src/utilities.rs @@ -26,7 +26,7 @@ use log::*; use tari_common::{CommsTransport, GlobalConfig, SocksAuthentication, TorControlAuthentication}; use tari_comms::{ connectivity::ConnectivityError, - peer_manager::NodeId, + peer_manager::{NodeId, PeerManagerError}, protocol::rpc::RpcError, socks, tor, @@ -146,6 +146,12 @@ impl From for ExitCodes { } } +impl From for ExitCodes { + fn from(err: PeerManagerError) -> Self { + ExitCodes::NetworkError(err.to_string()) + } +} + impl ExitCodes { pub fn grpc(err: M) -> Self { ExitCodes::GrpcError(format!("GRPC connection error: {}", err)) diff --git a/applications/tari_console_wallet/src/recovery.rs b/applications/tari_console_wallet/src/recovery.rs index dfdef8f3f8..887995f0a5 100644 --- a/applications/tari_console_wallet/src/recovery.rs +++ b/applications/tari_console_wallet/src/recovery.rs @@ -83,11 +83,14 @@ pub async fn wallet_recovery(wallet: &WalletSqlite, base_node_config: &PeerConfi let shutdown = Shutdown::new(); let shutdown_signal = shutdown.to_signal(); - let peer_public_keys = base_node_config - .get_all_peers() - .iter() - .map(|peer| peer.public_key.clone()) - .collect(); + let peers = base_node_config.get_all_peers(); + + let peer_manager = wallet.comms.peer_manager(); + let mut peer_public_keys = Vec::with_capacity(peers.len()); + for peer in peers { + peer_public_keys.push(peer.public_key.clone()); + peer_manager.add_peer(peer).await?; + } let mut recovery_task = UtxoScannerService::::builder() .with_peers(peer_public_keys)