File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,7 @@ impl<
116116 let mut last_emitted_header_height: u32 = 0 ;
117117 let mut last_emitted_filter_header_height: u32 = 0 ;
118118 let mut last_emitted_filters_downloaded: u64 = 0 ;
119+ let mut last_emitted_phase_name: Option < String > = None ;
119120
120121 loop {
121122 // Check if we should stop
@@ -363,10 +364,14 @@ impl<
363364 sync_progress. filter_sync_available = self . config . enable_filters ;
364365
365366 let filters_downloaded = sync_progress. filters_downloaded ;
367+ let current_phase_name = phase_snapshot. name ( ) . to_string ( ) ;
368+ let phase_changed =
369+ last_emitted_phase_name. as_ref ( ) != Some ( & current_phase_name) ;
366370
367371 if abs_header_height != last_emitted_header_height
368372 || filter_header_height != last_emitted_filter_header_height
369373 || filters_downloaded != last_emitted_filters_downloaded
374+ || phase_changed
370375 {
371376 let sync_stage =
372377 Self :: map_phase_to_stage ( & phase_snapshot, & sync_progress, peer_best) ;
@@ -391,6 +396,7 @@ impl<
391396 last_emitted_header_height = abs_header_height;
392397 last_emitted_filter_header_height = filter_header_height;
393398 last_emitted_filters_downloaded = filters_downloaded;
399+ last_emitted_phase_name = Some ( current_phase_name. clone ( ) ) ;
394400
395401 self . emit_progress ( progress) ;
396402 }
You can’t perform that action at this time.
0 commit comments