From 473734a8be6af59bc5ce9ee2c87f9c4018e529e5 Mon Sep 17 00:00:00 2001 From: patrini32 <171664803+patrini32@users.noreply.github.com> Date: Sun, 9 Jun 2024 09:22:49 +0300 Subject: [PATCH] provide better comments --- swap/src/cli/cancel_and_refund.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/swap/src/cli/cancel_and_refund.rs b/swap/src/cli/cancel_and_refund.rs index b6095664..ced5fb45 100644 --- a/swap/src/cli/cancel_and_refund.rs +++ b/swap/src/cli/cancel_and_refund.rs @@ -66,8 +66,8 @@ pub async fn cancel( } Err(err) => { if let Ok(tx) = state6.check_for_tx_cancel(bitcoin_wallet.as_ref()).await { - // Alice already cancelled, so we are out-of-sync with Alice. - let state = BobState::BtcCancelled(state6); // Set state to cancelled to sync with Alice. + // Alice already cancelled swap, so Bob sets his state to BtcCancelled. + let state = BobState::BtcCancelled(state6); db.insert_latest_state(swap_id, state.clone().into()) .await?; tracing::info!("Cancel transaction has already been confirmed on chain. The swap has therefore already been cancelled by Alice."); @@ -128,7 +128,7 @@ pub async fn refund( .await .is_ok() { - // Alice already punished us, so we are out-of-sync with Alice and should set our state to the BtcPunished. + // Alice already punished Bob, so Bob sets his state to BtcPunished. let state = BobState::BtcPunished { tx_lock_id: state6.tx_lock_id(), };