mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-01-11 15:39:37 -05:00
Use while instead of loop
This commit is contained in:
parent
c86a82b315
commit
def3399d1c
@ -215,11 +215,7 @@ pub async fn poll_until_block_height_is_gte<B>(client: &B, target: u32)
|
|||||||
where
|
where
|
||||||
B: BlockHeight,
|
B: BlockHeight,
|
||||||
{
|
{
|
||||||
loop {
|
while client.block_height().await < target {
|
||||||
if client.block_height().await >= target {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
tokio::time::delay_for(std::time::Duration::from_secs(1)).await;
|
tokio::time::delay_for(std::time::Duration::from_secs(1)).await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user