Handle errors when waiting for subscriptions

We were not thorough enough in PR #705 and there were some remaining
unhandled errors.

Co-authored-by: Daniel Karzel <daniel@comit.network>
This commit is contained in:
rishflab 2021-09-02 13:29:52 +10:00
parent 699b16bc43
commit ce58b8b333
3 changed files with 14 additions and 3 deletions

View file

@ -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,
@ -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,

View file

@ -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();