From 7e693de05907cd5cfd5876bd64fe784deb0192f4 Mon Sep 17 00:00:00 2001 From: Riccardo Casatta Date: Tue, 21 Nov 2023 10:35:58 +0200 Subject: [PATCH] wip: in_place_scope --- src/p2p.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p2p.rs b/src/p2p.rs index dfb7cd715..a1a5f1f69 100644 --- a/src/p2p.rs +++ b/src/p2p.rs @@ -111,7 +111,7 @@ impl Connection { self.req_send.send(Request::get_blocks(&blockhashes)) })?; - rayon::scope(|s| { + rayon::in_place_scope(|s| { let (send, receive) = std::sync::mpsc::channel(); for hash in blockhashes { @@ -142,6 +142,7 @@ impl Connection { debug!("waiting for {} blocks", blockhashes_len); let result: Result, std::sync::mpsc::RecvError> = (0..blockhashes_len).map(|_| receive.recv()).collect(); + debug!("waited for {} blocks", blockhashes_len); match result { Ok(result) => {