Skip to content

Commit d0bb594

Browse files
committed
fmt
1 parent b427a05 commit d0bb594

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/actions/scan_chain.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ async fn scan_auto_step(
8484
.as_u64() as i64;
8585

8686
let scan_behind_needed =
87-
scan_info.start_block <= scan_blockchain_options.from_block.unwrap_or(1) as i64;
87+
scan_info.start_block < scan_blockchain_options.from_block.unwrap_or(1) as i64;
8888

8989
let (start_block, end_block, is_forward) = if scan_behind_needed {
9090
if current_block - scan_info.last_block
@@ -274,7 +274,10 @@ pub async fn scan_blockchain_local(
274274
Ok(wait) => {
275275
log::info!("Scan step done");
276276
if wait {
277-
tokio::time::sleep(std::time::Duration::from_millis(2000)).await;
277+
tokio::time::sleep(std::time::Duration::from_secs(
278+
scan_blockchain_options.scan_interval,
279+
))
280+
.await;
278281
}
279282
}
280283
Err(e) => {

src/options.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,13 @@ pub struct ScanBlockchainOptions {
251251
)]
252252
pub blocks_at_once: u64,
253253

254+
#[structopt(
255+
long = "scan-interval",
256+
default_value = "2",
257+
help = "How often check for newest blocks"
258+
)]
259+
pub scan_interval: u64,
260+
254261
#[structopt(long = "import-balances")]
255262
pub import_balances: bool,
256263

0 commit comments

Comments
 (0)