mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-05-20 15:40:48 -04:00
Do not guard waiting for encrypted signature with arbitrary timeout
We already select waiting for this message with the cancellation expiry, we do not need add another guard that tries to guess how long it would for the Monero transaction to be finalised.
This commit is contained in:
parent
95ecb02e7a
commit
17356eaff9
3 changed files with 6 additions and 29 deletions
|
@ -7,7 +7,7 @@ use futures::{
|
|||
use libp2p::request_response::ResponseChannel;
|
||||
use rand::rngs::OsRng;
|
||||
use sha2::Sha256;
|
||||
use std::{sync::Arc, time::Duration};
|
||||
use std::sync::Arc;
|
||||
use tokio::time::timeout;
|
||||
use tracing::{info, trace};
|
||||
|
||||
|
@ -147,11 +147,11 @@ where
|
|||
|
||||
pub async fn wait_for_bitcoin_encrypted_signature(
|
||||
event_loop_handle: &mut EventLoopHandle,
|
||||
timeout_duration: Duration,
|
||||
) -> Result<EncryptedSignature> {
|
||||
let msg3 = timeout(timeout_duration, event_loop_handle.recv_message3())
|
||||
let msg3 = event_loop_handle
|
||||
.recv_message3()
|
||||
.await
|
||||
.context("Failed to receive Bitcoin encrypted signature from Bob")??;
|
||||
.context("Failed to receive Bitcoin encrypted signature from Bob")?;
|
||||
Ok(msg3.tx_redeem_encsig)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue