Explorar el Código

Restrict next_index to be non-zero.

Otherwise we start with a install snapshot request at the beginning of
the term.
Jing Yang hace 3 años
padre
commit
aac1aed60b
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  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));
     }