From 4e9e18646209d5ec4a8f745787271a31cebe8f3c Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Fri, 26 Feb 2021 17:04:51 +1100 Subject: [PATCH] Don't log things the user doesn't care about The user configured neither a Bitcoin wallet backend nor the monero-wallet-rpc so let's not tell them about it. Fixes #244. --- swap/src/bin/swap_cli.rs | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/swap/src/bin/swap_cli.rs b/swap/src/bin/swap_cli.rs index 1dcd6959..75bf94fd 100644 --- a/swap/src/bin/swap_cli.rs +++ b/swap/src/bin/swap_cli.rs @@ -325,13 +325,7 @@ async fn init_wallets( bitcoin_wallet .sync_wallet() .await - .expect("Could not sync btc wallet"); - - let bitcoin_balance = bitcoin_wallet.balance().await?; - info!( - "Connection to Bitcoin wallet succeeded, balance: {}", - bitcoin_balance - ); + .context("failed to sync balance of bitcoin wallet")?; let monero_wallet = monero::Wallet::new( monero_wallet_rpc_url.clone(), @@ -357,15 +351,12 @@ async fn init_wallets( "Created Monero wallet for blockchain monitoring with name {}", MONERO_BLOCKCHAIN_MONITORING_WALLET_NAME ); - } else { - info!( - "Opened Monero wallet for blockchain monitoring with name {}", - MONERO_BLOCKCHAIN_MONITORING_WALLET_NAME - ); } - let _test_wallet_connection = monero_wallet.block_height().await?; - info!("The Monero wallet RPC is set up correctly!"); + let _test_wallet_connection = monero_wallet + .block_height() + .await + .context("failed to validate connection to monero-wallet-rpc")?; Ok((bitcoin_wallet, monero_wallet)) }