Skip to content

Commit c5ba627

Browse files
committed
Error handling during startup: reregistering ENGINE timer.
1 parent 760cd44 commit c5ba627

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

crates/ethcore/src/engines/hbbft/hbbft_engine.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,12 @@ impl IoHandler<()> for TransitionHandler {
345345
if timer == ENGINE_TIMEOUT_TOKEN {
346346
if let Err(err) = self.handle_engine(io) {
347347
trace!(target: "consensus", "Error in Honey Badger Engine timeout handler: {:?}", err);
348+
349+
// in error cases we try again soon.
350+
io.register_timer_once(ENGINE_TIMEOUT_TOKEN, DEFAULT_DURATION)
351+
.unwrap_or_else(
352+
|e| warn!(target: "consensus", "Failed to restart consensus step timer: {}.", e),
353+
);
348354
}
349355
} else if timer == ENGINE_SHUTDOWN {
350356
// we do not run this on the first occurence,

0 commit comments

Comments
 (0)