Преглед изворни кода

Restrict next_index to be non-zero.

Otherwise we start with a install snapshot request at the beginning of
the term.
Jing Yang пре 3 година
родитељ
комит
aac1aed60b
1 измењених фајлова са 1 додато и 0 уклоњено
  1. 1 0
      src/sync_log_entries.rs

+ 1 - 0
src/sync_log_entries.rs

@@ -45,6 +45,7 @@ impl SyncLogEntriesComms {
     }
 
     pub fn reset_progress(&self, term: Term, index: Index) {
+        let index = std::cmp::max(index, 1);
         let _ = self.tx.send(Event::NewTerm(term, index));
     }