diff --git a/swap/src/protocol/alice/recovery/punish.rs b/swap/src/protocol/alice/recovery/punish.rs index 488017be..5a06b5ec 100644 --- a/swap/src/protocol/alice/recovery/punish.rs +++ b/swap/src/protocol/alice/recovery/punish.rs @@ -7,10 +7,10 @@ use uuid::Uuid; #[derive(Debug, thiserror::Error)] pub enum Error { - // Errors indicating the the swap can *currently* not be refunded but might be later - #[error("Cannot punish because swap is not in a cancelled state. Make sure to cancel the swap before trying to punish or use --force.")] + // Errors indicating the swap can *currently* not be punished but might be later + #[error("Swap is not in a cancelled state Make sure to cancel the swap before trying to punish or use --force.")] SwapNotCancelled, - #[error("The punish timelock has not expired yet because the timelock has not expired. Please try again later")] + #[error("The punish transaction cannot be published because the punish timelock has not expired yet. Please try again later")] PunishTimelockNotExpiredYet, // Errors indicating that the swap cannot be refunded because it is in a abort/final state diff --git a/swap/src/protocol/alice/recovery/refund.rs b/swap/src/protocol/alice/recovery/refund.rs index 2f0fe86f..8168bace 100644 --- a/swap/src/protocol/alice/recovery/refund.rs +++ b/swap/src/protocol/alice/recovery/refund.rs @@ -9,7 +9,7 @@ use uuid::Uuid; #[derive(Debug, thiserror::Error)] pub enum Error { - // Errors indicating the the swap can *currently* not be refunded but might be later + // Errors indicating the swap can *currently* not be refunded but might be later #[error("Swap is not in a cancelled state. Make sure to cancel the swap before trying to refund or use --force.")] SwapNotCancelled, #[error( @@ -19,7 +19,7 @@ pub enum Error { // Errors indicating that the swap cannot be refunded because because it is in a abort/final // state - #[error("Swa is in state {0} where no XMR was locked. Try aborting instead.")] + #[error("Swap is in state {0} where no XMR was locked. Try aborting instead.")] NoXmrLocked(AliceState), #[error("Swap is in state {0} which is not refundable")] SwapNotRefundable(AliceState), diff --git a/swap/src/protocol/alice/state.rs b/swap/src/protocol/alice/state.rs index d8b7d004..80f12a0a 100644 --- a/swap/src/protocol/alice/state.rs +++ b/swap/src/protocol/alice/state.rs @@ -513,13 +513,10 @@ impl State3 { pub async fn punish_btc(&self, bitcoin_wallet: &bitcoin::Wallet) -> Result { let signed_tx_punish = self.signed_punish_transaction()?; - async { - let (txid, subscription) = bitcoin_wallet.broadcast(signed_tx_punish, "punish").await?; - subscription.wait_until_final().await?; + let (txid, subscription) = bitcoin_wallet.broadcast(signed_tx_punish, "punish").await?; + subscription.wait_until_final().await?; - Result::<_, anyhow::Error>::Ok(txid) - } - .await + Ok(txid) } pub fn signed_redeem_transaction(