mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2024-12-30 16:06:30 +00:00
Process transfers in parallel.
This commit is contained in:
parent
1ca99b8c4c
commit
e7fba3a473
@ -442,8 +442,15 @@ pub fn process_transfers(
|
||||
transfers.len() as u64 <= spec.max_transfers,
|
||||
Invalid::MaxTransfersExceed
|
||||
);
|
||||
|
||||
transfers
|
||||
.par_iter()
|
||||
.enumerate()
|
||||
.try_for_each(|(i, transfer)| {
|
||||
verify_transfer(&state, transfer, spec).map_err(|e| e.into_with_index(i))
|
||||
})?;
|
||||
|
||||
for (i, transfer) in transfers.iter().enumerate() {
|
||||
verify_transfer(&state, transfer, spec).map_err(|e| e.into_with_index(i))?;
|
||||
execute_transfer(state, transfer, spec).map_err(|e| e.into_with_index(i))?;
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ impl TestingTransferBuilder {
|
||||
pub fn new(from: u64, to: u64, amount: u64, slot: Slot) -> Self {
|
||||
let keypair = Keypair::random();
|
||||
|
||||
let mut transfer = Transfer {
|
||||
let transfer = Transfer {
|
||||
from,
|
||||
to,
|
||||
amount,
|
||||
|
Loading…
Reference in New Issue
Block a user