From 3ae09de0190ededd318fc50e35d2974f85400bc9 Mon Sep 17 00:00:00 2001 From: keorn Date: Wed, 7 Dec 2016 11:40:46 +0100 Subject: [PATCH] restore is_new_best --- ethcore/src/engines/authority_round.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ethcore/src/engines/authority_round.rs b/ethcore/src/engines/authority_round.rs index a478df6bb..c78193e3f 100644 --- a/ethcore/src/engines/authority_round.rs +++ b/ethcore/src/engines/authority_round.rs @@ -304,7 +304,16 @@ impl Engine for AuthorityRound { } fn is_new_best_block(&self, _best_total_difficulty: U256, best_header: HeaderView, _parent_details: &BlockDetails, new_header: &HeaderView) -> bool { - new_header.number() > best_header.number() + let new_number = new_header.number(); + let best_number = best_header.number(); + if new_number != best_number { + new_number > best_number + } else { + // Take the oldest step at given height. + let new_step: usize = Rlp::new(&new_header.seal()[0]).as_val(); + let best_step: usize = Rlp::new(&best_header.seal()[0]).as_val(); + new_step < best_step + } } fn register_message_channel(&self, message_channel: IoChannel) {