Skip to content

Commit

Permalink
fixup: Remove last_added_checksum
Browse files Browse the repository at this point in the history
  • Loading branch information
johanhelsing committed Oct 21, 2023
1 parent 75a7636 commit e1ecb0d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/network/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ where

// debug desync
pub(crate) pending_checksums: VecDeque<(Frame, u128)>,
last_added_checksum_frame: Frame,
}

impl<T: Config> PartialEq for UdpProtocol<T> {
Expand Down Expand Up @@ -262,7 +261,6 @@ impl<T: Config> UdpProtocol<T> {

// debug desync
pending_checksums: VecDeque::new(),
last_added_checksum_frame: NULL_FRAME,
}
}

Expand Down Expand Up @@ -710,12 +708,10 @@ impl<T: Config> UdpProtocol<T> {

/// Upon receiving a `ChecksumReport`, add it to the checksum history
fn on_checksum_report(&mut self, body: &ChecksumReport) {
if self.last_added_checksum_frame < body.frame {
self.pending_checksums
.truncate(MAX_CHECKSUM_HISTORY_SIZE - 1);
self.pending_checksums
.push_front((body.frame, body.checksum));
}
self.pending_checksums
.truncate(MAX_CHECKSUM_HISTORY_SIZE - 1);
self.pending_checksums
.push_front((body.frame, body.checksum));
}

/// Returns the frame of the last received input
Expand Down

0 comments on commit e1ecb0d

Please sign in to comment.