diff --git a/src/network/ledger.rs b/src/network/ledger.rs index 7988f3611f..63c7ff0a61 100644 --- a/src/network/ledger.rs +++ b/src/network/ledger.rs @@ -518,34 +518,26 @@ impl Ledger { _ => State::Ready, }; - if E::NODE_TYPE == NodeType::Miner { - // Retrieve the latest cumulative weight of this node. - let latest_cumulative_weight = self.canon.latest_cumulative_weight(); - // Iterate through the connected peers, to determine if the ledger state is out of date. - for (_, peer_state) in self.peers_state.read().await.iter() { - if let Some((_, _, is_fork, block_height, block_locators)) = peer_state { - // Retrieve the cumulative weight, defaulting to the block height if it does not exist. - let cumulative_weight = match block_locators.get_cumulative_weight(*block_height) { - Some(cumulative_weight) => cumulative_weight, - None => *block_height as u128, - }; - // If the cumulative weight is more, set the status to `Syncing`. - if cumulative_weight > latest_cumulative_weight && is_fork.is_some() { - // Sync if this difference in cumulative weight is greater than 2. - if cumulative_weight - latest_cumulative_weight > 2 { - // Set the status to `Syncing`. - status = State::Syncing; - break; - } + // Retrieve the latest cumulative weight of this node. + let latest_cumulative_weight = self.canon.latest_cumulative_weight(); + // Iterate through the connected peers, to determine if the ledger state is out of date. + for (_, peer_state) in self.peers_state.read().await.iter() { + if let Some((_, _, is_fork, block_height, block_locators)) = peer_state { + // Retrieve the cumulative weight, defaulting to the block height if it does not exist. + let cumulative_weight = match block_locators.get_cumulative_weight(*block_height) { + Some(cumulative_weight) => cumulative_weight, + None => *block_height as u128, + }; + // If the cumulative weight is more, set the status to `Syncing`. + if cumulative_weight > latest_cumulative_weight && is_fork.is_some() { + // Sync if this difference in cumulative weight is greater than 2. + if cumulative_weight - latest_cumulative_weight > 2 { + // Set the status to `Syncing`. + status = State::Syncing; + break; } } } - } else { - // If there are pending block requests, set the status to `Syncing`. - if self.number_of_block_requests().await > 0 { - // Set the status to `Syncing`. - status = State::Syncing; - } } }