Skip to content

Commit

Permalink
EarlyEpochEndManager Impl
Browse files Browse the repository at this point in the history
  • Loading branch information
SurfingNerd committed Nov 19, 2023
1 parent 0c43542 commit 9b9d3b9
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions crates/ethcore/src/engines/hbbft/hbbft_early_epoch_end_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,26 @@ pub(crate) struct EarlyEpochEndManager {
/// public keys of all validators for this epoch.
validators: Vec<NodeId>,

}


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<NodeId> ) {

self.current_tracked_epoch_number = epoch;
self.validators = validators;
self.start_time = Instant::now();
}

}

0 comments on commit 9b9d3b9

Please sign in to comment.