From a6d8a2930c916e13eb44dd87266a7b189df28a4e Mon Sep 17 00:00:00 2001 From: binarybaron <86064887+binarybaron@users.noreply.github.com> Date: Thu, 27 Jun 2024 17:23:31 +0200 Subject: [PATCH] Update cancel_and_refund.rs --- swap/src/cli/cancel_and_refund.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/swap/src/cli/cancel_and_refund.rs b/swap/src/cli/cancel_and_refund.rs index fdcfd303..e92283ea 100644 --- a/swap/src/cli/cancel_and_refund.rs +++ b/swap/src/cli/cancel_and_refund.rs @@ -71,7 +71,7 @@ pub async fn cancel( let state = BobState::BtcCancelled(state6); db.insert_latest_state(swap_id, state.clone().into()) .await?; - tracing::info!("Cancel transaction has already been published by Alice"); + tracing::info!("Alice has already cancelled the swap"); return Ok((tx.txid(), state)); } @@ -89,9 +89,12 @@ pub async fn cancel( bail!(err.context("Cannot cancel swap because we have already been punished")); } // We cannot cancel because the cancel timelock has not expired yet - Ok(ExpiredTimelocks::None { .. }) => { + Ok(ExpiredTimelocks::None { blocks_left }) => { bail!(err.context( - "Cannot cancel swap because the cancel timelock has not expired yet" + format!( + "Cannot cancel swap because the cancel timelock has not expired yet. Blocks left: {}", + blocks_left + ) )); } Ok(ExpiredTimelocks::Cancel { .. }) => {