Skip to content

Commit

Permalink
Keep the task for view one less than the current. We might still be t…
Browse files Browse the repository at this point in the history
…ransmitting
  • Loading branch information
lukaszrzasik committed Dec 12, 2024
1 parent ce40829 commit 979c0c8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/task-impls/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,11 @@ impl<

/// Cancel all tasks for previous views
pub fn cancel_tasks(&mut self, view: TYPES::View) {
let keep = self.transmit_tasks.split_off(&view);
if *view == 0 {
return;
}
let keep_view = view - 1;
let keep = self.transmit_tasks.split_off(&keep_view);

while let Some((_, tasks)) = self.transmit_tasks.pop_first() {
for task in tasks {
Expand Down

0 comments on commit 979c0c8

Please sign in to comment.