Simplify code within BobState::EncSigSent

pull/325/head
Thomas Eizinger 3 years ago
parent 09e2d5b5d7
commit c32ef92cf5
No known key found for this signature in database
GPG Key ID: 651AC83A6C6C8B96

@ -193,16 +193,11 @@ async fn run_until_internal(
}
BobState::EncSigSent(state) => {
if let ExpiredTimelocks::None = state.expired_timelock(bitcoin_wallet.as_ref()).await? {
let state_clone = state.clone();
let redeem_watcher = state_clone.watch_for_redeem_btc(bitcoin_wallet.as_ref());
let cancel_timelock_expires =
state_clone.wait_for_cancel_timelock_to_expire(bitcoin_wallet.as_ref());
select! {
state5 = redeem_watcher => {
state5 = state.watch_for_redeem_btc(bitcoin_wallet.as_ref()) => {
BobState::BtcRedeemed(state5?)
},
_ = cancel_timelock_expires => {
_ = state.wait_for_cancel_timelock_to_expire(bitcoin_wallet.as_ref()) => {
BobState::CancelTimelockExpired(state)
}
}

Loading…
Cancel
Save