|
|
@ -67,8 +67,7 @@ pub enum AliceState {
|
|
|
|
tx_cancel: TxCancel,
|
|
|
|
tx_cancel: TxCancel,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
BtcRefunded {
|
|
|
|
BtcRefunded {
|
|
|
|
tx_refund: TxRefund,
|
|
|
|
spend_key: monero::PrivateKey,
|
|
|
|
published_refund_tx: ::bitcoin::Transaction,
|
|
|
|
|
|
|
|
state3: State3,
|
|
|
|
state3: State3,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
BtcPunishable {
|
|
|
|
BtcPunishable {
|
|
|
@ -244,8 +243,9 @@ pub async fn run_until(
|
|
|
|
tracing::info!("Cannot resume swap from BTC locked state, aborting");
|
|
|
|
tracing::info!("Cannot resume swap from BTC locked state, aborting");
|
|
|
|
|
|
|
|
|
|
|
|
// Alice did not lock Xmr yet
|
|
|
|
// Alice did not lock Xmr yet
|
|
|
|
swap(
|
|
|
|
run_until(
|
|
|
|
AliceState::SafelyAborted,
|
|
|
|
AliceState::SafelyAborted,
|
|
|
|
|
|
|
|
is_target_state,
|
|
|
|
event_loop_handle,
|
|
|
|
event_loop_handle,
|
|
|
|
bitcoin_wallet,
|
|
|
|
bitcoin_wallet,
|
|
|
|
monero_wallet,
|
|
|
|
monero_wallet,
|
|
|
@ -401,12 +401,16 @@ pub async fn run_until(
|
|
|
|
.await
|
|
|
|
.await
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Some(published_refund_tx) => {
|
|
|
|
Some(published_refund_tx) => {
|
|
|
|
run_until(
|
|
|
|
let spend_key = extract_monero_private_key(
|
|
|
|
AliceState::BtcRefunded {
|
|
|
|
|
|
|
|
tx_refund,
|
|
|
|
|
|
|
|
published_refund_tx,
|
|
|
|
published_refund_tx,
|
|
|
|
state3,
|
|
|
|
tx_refund,
|
|
|
|
},
|
|
|
|
state3.s_a,
|
|
|
|
|
|
|
|
state3.a.clone(),
|
|
|
|
|
|
|
|
state3.S_b_bitcoin,
|
|
|
|
|
|
|
|
)?;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
run_until(
|
|
|
|
|
|
|
|
AliceState::BtcRefunded { spend_key, state3 },
|
|
|
|
is_target_state,
|
|
|
|
is_target_state,
|
|
|
|
event_loop_handle,
|
|
|
|
event_loop_handle,
|
|
|
|
bitcoin_wallet.clone(),
|
|
|
|
bitcoin_wallet.clone(),
|
|
|
@ -417,18 +421,7 @@ pub async fn run_until(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
AliceState::BtcRefunded {
|
|
|
|
AliceState::BtcRefunded { spend_key, state3 } => {
|
|
|
|
tx_refund,
|
|
|
|
|
|
|
|
published_refund_tx,
|
|
|
|
|
|
|
|
state3,
|
|
|
|
|
|
|
|
} => {
|
|
|
|
|
|
|
|
let spend_key = extract_monero_private_key(
|
|
|
|
|
|
|
|
published_refund_tx,
|
|
|
|
|
|
|
|
tx_refund,
|
|
|
|
|
|
|
|
state3.s_a,
|
|
|
|
|
|
|
|
state3.a.clone(),
|
|
|
|
|
|
|
|
state3.S_b_bitcoin,
|
|
|
|
|
|
|
|
)?;
|
|
|
|
|
|
|
|
let view_key = state3.v;
|
|
|
|
let view_key = state3.v;
|
|
|
|
|
|
|
|
|
|
|
|
monero_wallet
|
|
|
|
monero_wallet
|
|
|
@ -472,12 +465,16 @@ pub async fn run_until(
|
|
|
|
.await
|
|
|
|
.await
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Either::Right((published_refund_tx, _)) => {
|
|
|
|
Either::Right((published_refund_tx, _)) => {
|
|
|
|
run_until(
|
|
|
|
let spend_key = extract_monero_private_key(
|
|
|
|
AliceState::BtcRefunded {
|
|
|
|
|
|
|
|
tx_refund,
|
|
|
|
|
|
|
|
published_refund_tx,
|
|
|
|
published_refund_tx,
|
|
|
|
state3,
|
|
|
|
tx_refund,
|
|
|
|
},
|
|
|
|
state3.s_a,
|
|
|
|
|
|
|
|
state3.a.clone(),
|
|
|
|
|
|
|
|
state3.S_b_bitcoin,
|
|
|
|
|
|
|
|
)?;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
run_until(
|
|
|
|
|
|
|
|
AliceState::BtcRefunded { spend_key, state3 },
|
|
|
|
is_target_state,
|
|
|
|
is_target_state,
|
|
|
|
event_loop_handle,
|
|
|
|
event_loop_handle,
|
|
|
|
bitcoin_wallet.clone(),
|
|
|
|
bitcoin_wallet.clone(),
|
|
|
|