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:
Franck Royer 2021-01-07 11:53:07 +11:00
parent 95ecb02e7a
commit 17356eaff9
No known key found for this signature in database
GPG key ID: A82ED75A8DFC50A4
3 changed files with 6 additions and 29 deletions

View file

@ -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)
}