File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,7 @@ pub fn get_blocks_for_range(
184184) {
185185 let mut batch = Vec :: new ( ) ;
186186 let mut rng = thread_rng ( ) ;
187+ let stop_height = { hints. lock ( ) . unwrap ( ) . stop_height ( ) } ;
187188 loop {
188189 let peer = {
189190 let lock_opt = peers. lock ( ) . ok ( ) ;
@@ -296,9 +297,14 @@ pub fn get_blocks_for_range(
296297 "[thread {task_id:2}]: requesting next batch. blocks downloaded: {}" ,
297298 CHUNK_SIZE * completed_batches
298299 ) ;
300+ let percent = ( 1.
301+ - ( ( CHUNK_SIZE * jobs_lock. len ( ) ) as f32 / stop_height as f32 ) )
302+ * 100.0 ;
299303 tracing:: info!(
300- "[thread m]: blocks remaining {}" ,
301- CHUNK_SIZE * jobs_lock. len( )
304+ "[thread m]: {:.6}/{}; progress: {:.6}%" ,
305+ CHUNK_SIZE * jobs_lock. len( ) ,
306+ stop_height,
307+ percent,
302308 ) ;
303309 let payload = InventoryPayload (
304310 batch. iter ( ) . map ( |hash| Inventory :: Block ( * hash) ) . collect ( ) ,
You can’t perform that action at this time.
0 commit comments