Skip to content

Commit

Permalink
Update cancel_and_refund.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
binarybaron committed Jun 27, 2024
1 parent 9460b2a commit a6d8a29
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions swap/src/cli/cancel_and_refund.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand All @@ -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 { .. }) => {
Expand Down

0 comments on commit a6d8a29

Please sign in to comment.