diff --git a/src/broadcast_stage.rs b/src/broadcast_stage.rs index 1ec06f1528..4bb0720cad 100644 --- a/src/broadcast_stage.rs +++ b/src/broadcast_stage.rs @@ -43,7 +43,10 @@ fn broadcast( let blobs_chunked = blobs_vec.chunks(WINDOW_SIZE as usize).map(|x| x.to_vec()); if log_enabled!(Level::Trace) { - trace!("{}", window::print_window(&id, window, *receive_index)); + trace!( + "{}", + window::print_window(&id, &window.read().unwrap(), *receive_index) + ); } for mut blobs in blobs_chunked { diff --git a/src/window.rs b/src/window.rs index 27d270eec0..c7e8afa035 100644 --- a/src/window.rs +++ b/src/window.rs @@ -465,7 +465,7 @@ fn recv_window( ); } if log_enabled!(Level::Trace) { - trace!("{}", print_window(id, window, *consumed)); + trace!("{}", print_window(id, &window.read().unwrap(), *consumed)); trace!( "{}: consumed: {} received: {} sending consume.len: {} pixs: {:?} took {} ms", id, @@ -483,10 +483,8 @@ fn recv_window( Ok(()) } -pub fn print_window(id: &Pubkey, window: &SharedWindow, consumed: u64) -> String { +pub fn print_window(id: &Pubkey, window: &Window, consumed: u64) -> String { let pointer: Vec<_> = window - .read() - .unwrap() .iter() .enumerate() .map(|(i, _v)| { @@ -499,8 +497,6 @@ pub fn print_window(id: &Pubkey, window: &SharedWindow, consumed: u64) -> String .collect(); let buf: Vec<_> = window - .read() - .unwrap() .iter() .map(|v| { if v.data.is_none() && v.coding.is_none() {