diff --git a/crates/ethcore/src/engines/hbbft/hbbft_early_epoch_end_manager.rs b/crates/ethcore/src/engines/hbbft/hbbft_early_epoch_end_manager.rs index 683687d41..016d1a836 100644 --- a/crates/ethcore/src/engines/hbbft/hbbft_early_epoch_end_manager.rs +++ b/crates/ethcore/src/engines/hbbft/hbbft_early_epoch_end_manager.rs @@ -16,4 +16,26 @@ pub(crate) struct EarlyEpochEndManager { /// public keys of all validators for this epoch. validators: Vec, +} + + +impl EarlyEpochEndManager { + + // new + pub fn new(allowed_devp2p_warmup_time: Duration) -> Self { + Self { + current_tracked_epoch_number: 0, + start_time: Instant::now(), + allowed_devp2p_warmup_time: allowed_devp2p_warmup_time, + validators: Vec::new(), + } + } + + pub fn notify_new_epoch(&mut self, epoch: u64, validators: Vec ) { + + self.current_tracked_epoch_number = epoch; + self.validators = validators; + self.start_time = Instant::now(); + } + } \ No newline at end of file