Skip to content

Commit

Permalink
wip: in_place_scope
Browse files Browse the repository at this point in the history
  • Loading branch information
RCasatta committed Nov 21, 2023
1 parent 67a3a0f commit 7e693de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/p2p.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -142,6 +142,7 @@ impl Connection {
debug!("waiting for {} blocks", blockhashes_len);
let result: Result<Vec<_>, std::sync::mpsc::RecvError> =
(0..blockhashes_len).map(|_| receive.recv()).collect();
debug!("waited for {} blocks", blockhashes_len);

match result {
Ok(result) => {
Expand Down

0 comments on commit 7e693de

Please sign in to comment.