Fail if something goes wrong when checking tx lock status

Probably a failure when interacting with the electrum node to get script
 status updates
This commit is contained in:
Daniel Karzel 2021-08-30 12:07:01 +10:00 committed by rishflab
parent 9d11cbb90d
commit 18faa786d6
3 changed files with 12 additions and 5 deletions

View File

@ -16,6 +16,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- An issue where the ASB was unable to use the Monero wallet in case `monero-wallet-rpc` has been restarted. - An issue where the ASB was unable to use the Monero wallet in case `monero-wallet-rpc` has been restarted.
In case no wallet is loaded when we try to interact with the `monero-wallet-rpc` daemon, we now load the correct wallet on-demand. In case no wallet is loaded when we try to interact with the `monero-wallet-rpc` daemon, we now load the correct wallet on-demand.
See issue https://github.com/comit-network/xmr-btc-swap/issues/652. See issue https://github.com/comit-network/xmr-btc-swap/issues/652.
- An issue where swap protocol was getting stuck trying to submit the cancel transaction.
We were not handling the error when TxCancel submission fails.
See issues: https://github.com/comit-network/xmr-btc-swap/issues/709, https://github.com/comit-network/xmr-btc-swap/issues/688, https://github.com/comit-network/xmr-btc-swap/issues/701.
## [0.8.1] - 2021-08-16 ## [0.8.1] - 2021-08-16

View File

@ -195,7 +195,8 @@ where
select! { select! {
biased; // make sure the cancel timelock expiry future is polled first biased; // make sure the cancel timelock expiry future is polled first
_ = 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 { AliceState::CancelTimelockExpired {
monero_wallet_restore_blockheight, monero_wallet_restore_blockheight,
transfer_proof, transfer_proof,

View File

@ -128,7 +128,7 @@ async fn next_state(
let state4 = state3.cancel(); let state4 = state3.cancel();
BobState::CancelTimelockExpired(state4) BobState::CancelTimelockExpired(state4)
} },
} }
} else { } else {
let state4 = state3.cancel(); let state4 = state3.cancel();
@ -159,7 +159,8 @@ async fn next_state(
}, },
} }
} }
_ = tx_lock_status.wait_until_confirmed_with(state.cancel_timelock) => { result = tx_lock_status.wait_until_confirmed_with(state.cancel_timelock) => {
let _ = result?;
BobState::CancelTimelockExpired(state.cancel()) BobState::CancelTimelockExpired(state.cancel())
} }
} }
@ -178,7 +179,8 @@ async fn next_state(
_ = event_loop_handle.send_encrypted_signature(state.tx_redeem_encsig()) => { _ = event_loop_handle.send_encrypted_signature(state.tx_redeem_encsig()) => {
BobState::EncSigSent(state) BobState::EncSigSent(state)
}, },
_ = tx_lock_status.wait_until_confirmed_with(state.cancel_timelock) => { result = tx_lock_status.wait_until_confirmed_with(state.cancel_timelock) => {
let _ = result?;
BobState::CancelTimelockExpired(state.cancel()) BobState::CancelTimelockExpired(state.cancel())
} }
} }
@ -194,7 +196,8 @@ async fn next_state(
state5 = state.watch_for_redeem_btc(bitcoin_wallet) => { state5 = state.watch_for_redeem_btc(bitcoin_wallet) => {
BobState::BtcRedeemed(state5?) BobState::BtcRedeemed(state5?)
}, },
_ = tx_lock_status.wait_until_confirmed_with(state.cancel_timelock) => { result = tx_lock_status.wait_until_confirmed_with(state.cancel_timelock) => {
let _ = result?;
BobState::CancelTimelockExpired(state.cancel()) BobState::CancelTimelockExpired(state.cancel())
} }
} }