Skip to content

Commit 3e7bc8f

Browse files
committed
removed empty blocks during key gen phase: DMDcoin#327
1 parent b117008 commit 3e7bc8f

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

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

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,6 @@ impl TransitionHandler {
329329

330330
// If the minimum block time has passed we are ready to trigger new blocks.
331331
if timer_duration == Duration::from_secs(0) {
332-
// Always create blocks if we are in the keygen phase.
333-
self.engine.start_hbbft_epoch_if_next_phase();
334332

335333
// If the maximum block time has been reached we trigger a new block in any case.
336334
if self.max_block_time_remaining(client.clone()) == Duration::from_secs(0) {
@@ -1104,27 +1102,6 @@ impl HoneyBadgerBFT {
11041102
self.client.read().as_ref().and_then(Weak::upgrade)
11051103
}
11061104

1107-
fn start_hbbft_epoch_if_next_phase(&self) {
1108-
// experimental deactivation of empty blocks.
1109-
// see: https://github.com/DMDcoin/diamond-node/issues/160
1110-
1111-
match self.client_arc() {
1112-
None => return,
1113-
Some(client) => {
1114-
// Get the next phase start time
1115-
let genesis_transition_time = match start_time_of_next_phase_transition(&*client) {
1116-
Ok(time) => time,
1117-
Err(_) => return,
1118-
};
1119-
1120-
// If current time larger than phase start time, start a new block.
1121-
if genesis_transition_time.as_u64() < unix_now_secs() {
1122-
self.start_hbbft_epoch(client);
1123-
}
1124-
}
1125-
}
1126-
}
1127-
11281105
fn replay_cached_messages(&self) -> Option<()> {
11291106
let client = self.client_arc()?;
11301107

0 commit comments

Comments
 (0)