Forráskód Böngészése

Restrict next_index to be non-zero.

Otherwise we start with a install snapshot request at the beginning of
the term.
Jing Yang 3 éve
szülő
commit
aac1aed60b
1 módosított fájl, 1 hozzáadás és 0 törlés
  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));
     }