rename transition

This commit is contained in:
keorn 2016-11-18 13:37:47 +00:00
parent e90d814193
commit 2f3b801296

View File

@ -16,7 +16,6 @@
//! Tendermint timeout handling. //! Tendermint timeout handling.
use std::sync::atomic::{Ordering as AtomicOrdering};
use std::sync::Weak; use std::sync::Weak;
use io::{IoContext, IoHandler, TimerToken}; use io::{IoContext, IoHandler, TimerToken};
use super::{Tendermint, Step}; use super::{Tendermint, Step};
@ -86,14 +85,12 @@ impl IoHandler<Step> for TransitionHandler {
}, },
Step::Precommit if engine.has_enough_any_votes() => { Step::Precommit if engine.has_enough_any_votes() => {
set_timeout(io, engine.our_params.timeouts.propose); set_timeout(io, engine.our_params.timeouts.propose);
engine.round.fetch_add(1, AtomicOrdering::SeqCst); engine.increment_round(1);
Some(Step::Propose) Some(Step::Propose)
}, },
Step::Commit => { Step::Commit => {
set_timeout(io, engine.our_params.timeouts.propose); set_timeout(io, engine.our_params.timeouts.propose);
engine.last_lock.store(0, AtomicOrdering::SeqCst); engine.reset_round();
engine.round.store(0, AtomicOrdering::SeqCst);
engine.height.fetch_add(1, AtomicOrdering::SeqCst);
Some(Step::Propose) Some(Step::Propose)
}, },
_ => None, _ => None,