From 0afe83e4e8bcbf2f95544617900777432be37653 Mon Sep 17 00:00:00 2001 From: rishflab Date: Thu, 9 Sep 2021 16:58:17 +1000 Subject: [PATCH] Move "swap started" UI message after swap confirmed with ASB The "swap started" message was being too early, before the ASB had confirmed they could perform the swap. This was leading to a confusing scenario where the UI incorrectly indicated to the user that the swap had started. Users were trying to resume or refund the swaps but there was no swap id in the db. Moving this message after the swap setup should resolve this problem. Closes #756, #729, #560. --- swap/src/bin/swap.rs | 2 +- swap/src/protocol/bob/swap.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/swap/src/bin/swap.rs b/swap/src/bin/swap.rs index b3f6fb05..9054f0a9 100644 --- a/swap/src/bin/swap.rs +++ b/swap/src/bin/swap.rs @@ -110,7 +110,7 @@ async fn main() -> Result<()> { ) .await?; - tracing::info!(%amount, %fees, %swap_id, "Starting new swap"); + tracing::info!(%amount, %fees, "Determined swap amount"); db.insert_peer_id(swap_id, seller_peer_id).await?; db.insert_monero_address(swap_id, monero_receive_address) diff --git a/swap/src/protocol/bob/swap.rs b/swap/src/protocol/bob/swap.rs index 1bb6587a..1369376c 100644 --- a/swap/src/protocol/bob/swap.rs +++ b/swap/src/protocol/bob/swap.rs @@ -82,6 +82,8 @@ async fn next_state( }) .await?; + tracing::info!(%swap_id, "Starting new swap"); + BobState::SwapSetupCompleted(state2) } BobState::SwapSetupCompleted(state2) => {