add transition tracing

This commit is contained in:
keorn 2016-11-25 16:44:57 +00:00
parent f59746b2da
commit 8f72017bcc

View File

@ -76,19 +76,23 @@ impl IoHandler<Step> for TransitionHandler {
if let Some(engine) = self.engine.upgrade() { if let Some(engine) = self.engine.upgrade() {
let next_step = match *engine.step.read() { let next_step = match *engine.step.read() {
Step::Propose => { Step::Propose => {
trace!(target: "poa", "timeout: Propose timeout.");
set_timeout(io, engine.our_params.timeouts.prevote); set_timeout(io, engine.our_params.timeouts.prevote);
Some(Step::Prevote) Some(Step::Prevote)
}, },
Step::Prevote if engine.has_enough_any_votes() => { Step::Prevote if engine.has_enough_any_votes() => {
trace!(target: "poa", "timeout: Prevote timeout.");
set_timeout(io, engine.our_params.timeouts.precommit); set_timeout(io, engine.our_params.timeouts.precommit);
Some(Step::Precommit) Some(Step::Precommit)
}, },
Step::Precommit if engine.has_enough_any_votes() => { Step::Precommit if engine.has_enough_any_votes() => {
trace!(target: "poa", "timeout: Precommit timeout.");
set_timeout(io, engine.our_params.timeouts.propose); set_timeout(io, engine.our_params.timeouts.propose);
engine.increment_round(1); engine.increment_round(1);
Some(Step::Propose) Some(Step::Propose)
}, },
Step::Commit => { Step::Commit => {
trace!(target: "poa", "timeout: Commit timeout.");
set_timeout(io, engine.our_params.timeouts.propose); set_timeout(io, engine.our_params.timeouts.propose);
engine.reset_round(); engine.reset_round();
Some(Step::Propose) Some(Step::Propose)