Skip to content

Commit

Permalink
Handle errors when waiting for subscriptions
Browse files Browse the repository at this point in the history
We were not thorough enough in PR #705 and there were some remaining
unhandled errors.
  • Loading branch information
rishflab committed Sep 2, 2021
1 parent 699b16b commit caa3a4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions swap/src/protocol/alice/swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ where
state3,
}
},
_ = tx_lock_status.wait_until_confirmed_with(state3.cancel_timelock) => {
result = tx_lock_status.wait_until_confirmed_with(state3.cancel_timelock) => {
let _ = result?;
AliceState::CancelTimelockExpired {
monero_wallet_restore_blockheight,
transfer_proof,
Expand Down Expand Up @@ -325,7 +326,9 @@ where
state3,
}
}
_ = tx_cancel_status.wait_until_confirmed_with(state3.punish_timelock) => {
result = tx_cancel_status.wait_until_confirmed_with(state3.punish_timelock) => {
let _ = result?;

AliceState::BtcPunishable {
monero_wallet_restore_blockheight,
transfer_proof,
Expand Down
3 changes: 2 additions & 1 deletion swap/src/protocol/bob/swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ async fn next_state(
monero_wallet_restore_blockheight
}
},
_ = cancel_timelock_expires => {
result = cancel_timelock_expires => {
let _ = result?;
tracing::info!("Alice took too long to lock Monero, cancelling the swap");

let state4 = state3.cancel();
Expand Down

0 comments on commit caa3a4d

Please sign in to comment.