diff --git a/crates/primitives/src/transaction/mod.rs b/crates/primitives/src/transaction/mod.rs index 1a0d312643432..e5da31d1ae05f 100644 --- a/crates/primitives/src/transaction/mod.rs +++ b/crates/primitives/src/transaction/mod.rs @@ -884,22 +884,22 @@ impl TransactionSigned { let mut channels = Vec::new(); - for chunk in vectors { - let (recovered_senders_tx, recovered_senders_rx) = mpsc::unbounded_channel(); - channels.push(recovered_senders_rx); - - // Spawn the sender recovery task onto the global rayon pool - // This task will send the results through the channel after it recovered the - // senders. - rayon::scope(|s| { + rayon::scope(|s| { + for chunk in vectors { + let (recovered_senders_tx, recovered_senders_rx) = mpsc::unbounded_channel(); + channels.push(recovered_senders_rx); + + // Spawn the sender recovery task onto the global rayon pool + // This task will send the results through the channel after it recovered the + // senders. s.spawn(move |_| { for tx in chunk { let recovery_result = tx.recover_signer(); let _ = recovered_senders_tx.send(recovery_result); } }); - }) - } + } + }); for mut channel in channels { while let Some(recovered) = channel.blocking_recv() {