File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff 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) => {
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments