From 05974620730c517337af2396805f8c90eca96408 Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Tue, 19 Nov 2024 11:06:31 +0100 Subject: [PATCH] Clarify that only missing transmissions are checked --- node/bft/src/primary.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node/bft/src/primary.rs b/node/bft/src/primary.rs index 7c2035e685..4f8225b55a 100644 --- a/node/bft/src/primary.rs +++ b/node/bft/src/primary.rs @@ -728,10 +728,10 @@ impl Primary { } // If the peer is ahead, use the batch header to sync up to the peer. - let mut transmissions = self.sync_with_batch_header_from_peer::(peer_ip, &batch_header).await?; + let mut missing_transmissions = self.sync_with_batch_header_from_peer::(peer_ip, &batch_header).await?; // Check that the transmission ids match and are not fee transactions. - if let Err(err) = cfg_iter_mut!(transmissions).try_for_each(|(transmission_id, transmission)| { + if let Err(err) = cfg_iter_mut!(missing_transmissions).try_for_each(|(transmission_id, transmission)| { // If the transmission is not well-formed, then return early. self.ledger.ensure_transmission_is_well_formed(*transmission_id, transmission) }) { @@ -751,7 +751,7 @@ impl Primary { // Ensure the batch header from the peer is valid. let (storage, header) = (self.storage.clone(), batch_header.clone()); let missing_transmissions = - spawn_blocking!(storage.check_batch_header(&header, transmissions, Default::default()))?; + spawn_blocking!(storage.check_batch_header(&header, missing_transmissions, Default::default()))?; // Inserts the missing transmissions into the workers. self.insert_missing_transmissions_into_workers(peer_ip, missing_transmissions.into_iter())?;