From b5a1d957c3035c3f0062b0a1cb4c6f3fa3926df8 Mon Sep 17 00:00:00 2001 From: ok300 <106775972+ok300@users.noreply.github.com> Date: Wed, 16 Oct 2024 13:18:43 +0200 Subject: [PATCH] Log exact error root cause when failing to lookup script address (#530) --- lib/core/src/chain_swap.rs | 2 +- lib/core/src/send_swap.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/core/src/chain_swap.rs b/lib/core/src/chain_swap.rs index 87055366f..3c154b894 100644 --- a/lib/core/src/chain_swap.rs +++ b/lib/core/src/chain_swap.rs @@ -864,7 +864,7 @@ impl ChainSwapHandler { let liquid_chain_service = self.liquid_chain_service.lock().await; let script_pk = swap_script .to_address(self.config.network.into()) - .map_err(|_| anyhow!("Could not retrieve address from swap script"))? + .map_err(|e| anyhow!("Could not retrieve address from swap script: {e:?}"))? .to_unconfidential() .script_pubkey(); let utxos = liquid_chain_service.get_script_utxos(&script_pk).await?; diff --git a/lib/core/src/send_swap.rs b/lib/core/src/send_swap.rs index bcfe08895..94cc28d9b 100644 --- a/lib/core/src/send_swap.rs +++ b/lib/core/src/send_swap.rs @@ -388,7 +388,7 @@ impl SendSwapHandler { let liquid_chain_service = self.chain_service.lock().await; let script_pk = swap_script .to_address(self.config.network.into()) - .map_err(|_| anyhow!("Could not retrieve address from swap script"))? + .map_err(|e| anyhow!("Could not retrieve address from swap script: {e:?}"))? .to_unconfidential() .script_pubkey(); let utxos = liquid_chain_service.get_script_utxos(&script_pk).await?;