From def3399d1c6d845c1e8150390930b33fe84fa056 Mon Sep 17 00:00:00 2001 From: Lucas Soriano del Pino Date: Mon, 26 Oct 2020 11:00:33 +1100 Subject: [PATCH] Use while instead of loop --- xmr-btc/src/bitcoin.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/xmr-btc/src/bitcoin.rs b/xmr-btc/src/bitcoin.rs index 9ac38365..da75fd6f 100644 --- a/xmr-btc/src/bitcoin.rs +++ b/xmr-btc/src/bitcoin.rs @@ -215,11 +215,7 @@ pub async fn poll_until_block_height_is_gte(client: &B, target: u32) where B: BlockHeight, { - loop { - if client.block_height().await >= target { - return; - } - + while client.block_height().await < target { tokio::time::delay_for(std::time::Duration::from_secs(1)).await; } }