diff --git a/src/phoenix/consensus_node.rs b/src/phoenix/consensus_node.rs index e1f0470..eab2034 100644 --- a/src/phoenix/consensus_node.rs +++ b/src/phoenix/consensus_node.rs @@ -36,10 +36,10 @@ impl ConsensusNodeMonitor { info!("{}/{} consensus nodes synced", synced.len(), results.len()); - if synced.len() > 0 { - Ok(Utc::now()) - } else { + if synced.is_empty() { Err(anyhow!("all consensus nodes out of sync")) + } else { + Ok(Utc::now()) } } } diff --git a/src/phoenix/validation_node.rs b/src/phoenix/validation_node.rs index 42164a9..77496d3 100644 --- a/src/phoenix/validation_node.rs +++ b/src/phoenix/validation_node.rs @@ -53,10 +53,10 @@ impl ValidationNodeMonitor { info!("{}/{} validation nodes synced", synced.len(), results.len()); - if synced.len() > 0 { - Ok(Utc::now()) - } else { + if synced.is_empty() { Err(anyhow!("all validation nodes out of sync")) + } else { + Ok(Utc::now()) } } }