From 790eaaa4f4b075d72ffd583486613e05dd31d654 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Mon, 18 Oct 2021 14:57:15 +1100 Subject: [PATCH] Add timeouts to rollover messages --- daemon/src/setup_contract.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/daemon/src/setup_contract.rs b/daemon/src/setup_contract.rs index c2042e9..1cd7e08 100644 --- a/daemon/src/setup_contract.rs +++ b/daemon/src/setup_contract.rs @@ -276,7 +276,9 @@ pub async fn roll_over( .context("Failed to send Msg0")?; let msg0 = stream .select_next_some() + .timeout(Duration::from_secs(60)) .await + .context("Expected Msg0 within 60 seconds")? .try_into_msg0() .context("Failed to read Msg0")?; @@ -344,7 +346,9 @@ pub async fn roll_over( let msg1 = stream .select_next_some() + .timeout(Duration::from_secs(60)) .await + .context("Expected Msg1 within 60 seconds")? .try_into_msg1() .context("Failed to read Msg1")?; @@ -461,7 +465,9 @@ pub async fn roll_over( let msg2 = stream .select_next_some() + .timeout(Duration::from_secs(60)) .await + .context("Expected Msg2 within 60 seconds")? .try_into_msg2() .context("Failed to read Msg2")?; let revocation_sk_theirs = msg2.revocation_sk;