mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-06-18 11:59:25 -04:00
Refund if Alice takes too long to prove that Monero has been locked
This commit is contained in:
parent
176b2195e3
commit
c1f6adc8ed
1 changed files with 10 additions and 1 deletions
|
@ -151,7 +151,16 @@ where
|
||||||
futures::pin_mut!(poll_until_btc_has_expired);
|
futures::pin_mut!(poll_until_btc_has_expired);
|
||||||
|
|
||||||
// the source of this could be the database, this layer doesn't care
|
// the source of this could be the database, this layer doesn't care
|
||||||
let transfer_proof = network.receive_transfer_proof().await;
|
|
||||||
|
let transfer_proof = match select(
|
||||||
|
network.receive_transfer_proof(),
|
||||||
|
poll_until_btc_has_expired.clone(),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
Either::Left((proof, _)) => proof,
|
||||||
|
Either::Right(_) => return Err(SwapFailed::TimelockReached),
|
||||||
|
};
|
||||||
|
|
||||||
let S_b_monero = monero::PublicKey::from_private_key(&monero::PrivateKey::from_scalar(
|
let S_b_monero = monero::PublicKey::from_private_key(&monero::PrivateKey::from_scalar(
|
||||||
s_b.into_ed25519(),
|
s_b.into_ed25519(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue