diff --git a/node/src/actors/chain_manager/handlers.rs b/node/src/actors/chain_manager/handlers.rs index 19525b3e8..dd3beea5c 100644 --- a/node/src/actors/chain_manager/handlers.rs +++ b/node/src/actors/chain_manager/handlers.rs @@ -134,13 +134,14 @@ impl Handler> for ChainManager { // The best candidate must be cleared on every epoch let best_candidate = self.best_candidate.take(); - // Make sure that the protocol info in the chain state is kept up to date + // Make sure that the protocol version in the chain state is kept up to date + let expected_protocol_version = get_protocol_version(self.current_epoch); + let current_protocol_version = get_protocol_version(None); if let Some(ChainInfo { protocol, .. }) = &mut self.chain_state.chain_info { - protocol.current_version = get_protocol_version(self.current_epoch); + protocol.current_version = expected_protocol_version; } - - // Update the global protocol version state if necessary - if get_protocol_version(self.current_epoch) != get_protocol_version(None) { + // Also update the global protocol version state if necessary + if expected_protocol_version != current_protocol_version { refresh_protocol_version(current_epoch); }