Move tick to the beginning of the loop

This ensures that we always wait for the provided interval, even in
the case of a `continue` which happens if there is an error within
the RPC call.
pull/383/head
Thomas Eizinger 3 years ago
parent 36b92c9f1f
commit 1b63d5486d
No known key found for this signature in database
GPG Key ID: 651AC83A6C6C8B96

@ -288,6 +288,8 @@ where
let mut seen_confirmations = 0u32;
while seen_confirmations < conf_target {
check_interval.tick().await; // tick() at the beginning of the loop so every `continue` tick()s as well
let tx = match fetch_tx(txid.clone()).await {
Ok(proof) => proof,
Err(error) => {
@ -312,8 +314,6 @@ where
seen_confirmations = tx.confirmations;
info!(%txid, "Monero lock tx has {} out of {} confirmations", tx.confirmations, conf_target);
}
check_interval.tick().await;
}
Ok(())

Loading…
Cancel
Save