Skip to content

Commit 78289f5

Browse files
committed
Phoenix Protocol: do not execute if major syncing
1 parent a01da67 commit 78289f5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ impl HoneyBadgerBFT {
498498
fn handle_phoenix_recovery_protocol(&self) {
499499
if let Some(client) = self.client_arc() {
500500
// Skip if still syncing.
501-
if self.is_syncing(&client) {
501+
if self.is_major_syncing(&client) {
502502
return;
503503
}
504504

@@ -1405,6 +1405,14 @@ impl HoneyBadgerBFT {
14051405
}
14061406
}
14071407

1408+
fn is_major_syncing(&self, client: &Arc<dyn EngineClient>) -> bool {
1409+
match client.as_full_client() {
1410+
Some(full_client) => full_client.is_major_syncing(),
1411+
// We only support full clients at this point.
1412+
None => true,
1413+
}
1414+
}
1415+
14081416
/** returns if the signer of hbbft is tracked as available in the hbbft contracts..*/
14091417
pub fn is_available(&self) -> bool {
14101418
self.hbbft_engine_cache.lock().is_available()

0 commit comments

Comments
 (0)