fix interval logic

This commit is contained in:
Robert Habermeier
2018-08-17 13:30:21 +02:00
parent 4e103f3d5f
commit 321441c1f7
+5 -1
View File
@@ -224,7 +224,11 @@ impl Service {
interval.map_err(|e| debug!("Timer error: {:?}", e)).for_each(move |_| {
if let Ok(best_block) = c.best_block_header() {
let hash = best_block.hash();
if hash == prev_best && s.live_agreement() != Some(hash) {
let last_agreement = s.last_agreement();
let can_build_upon = last_agreement
.map_or(true, |x| !x.live || x.parent_hash != hash);
if hash == prev_best && can_build_upon {
debug!("Starting consensus round after a timeout");
start_bft(best_block, s.clone());
}