From f0b4735163528add8d0b651ba482f205e6dbc134 Mon Sep 17 00:00:00 2001 From: binarybaron <86064887+binarybaron@users.noreply.github.com> Date: Tue, 19 Apr 2022 14:34:54 +0200 Subject: [PATCH] Update swap.rs --- swap/src/protocol/bob/swap.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/swap/src/protocol/bob/swap.rs b/swap/src/protocol/bob/swap.rs index c82bf10e..525644bf 100644 --- a/swap/src/protocol/bob/swap.rs +++ b/swap/src/protocol/bob/swap.rs @@ -193,7 +193,14 @@ async fn next_state( result = event_loop_handle.send_encrypted_signature(state.tx_redeem_encsig()) => { match result { Ok(_) => BobState::EncSigSent(state), - Err(bmrng::error::RequestError::RecvError | bmrng::error::RequestError::SendError(_)) => bail!("Failed to communicate encrypted signature through event loop channel"), + Err(bmrng::error::RequestError::RecvError | bmrng::error::RequestError::SendError(_)) => { + tracing::error("Failed to communicate encrypted signature through event loop channel"); + tracing::info!(timelock = %state.cancel_timelock, "Waiting for cancel timelock to expire"); + + tx_lock_status.wait_until_confirmed_with(state.cancel_timelock).await?; + + BobState::CancelTimelockExpired(state.cancel()) + }, Err(bmrng::error::RequestError::RecvTimeoutError) => unreachable!("We construct the channel with no timeout"), } },