Update swap.rs

wait-for-cancel-timelock-when-enc-sig-fails
binarybaron 2 years ago
parent 2391356c6a
commit f0b4735163

@ -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"),
}
},

Loading…
Cancel
Save