Skip to content

Commit

Permalink
feat(node): update global protocol version state when necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
drcpu-github committed Nov 13, 2024
1 parent 28b630d commit 27a580b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions node/src/actors/chain_manager/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use witnet_data_structures::{
error::{ChainInfoError, TransactionError::DataRequestNotFound},
get_protocol_version,
proto::versioning::ProtocolVersion,
refresh_protocol_version,
staking::{errors::StakesError, prelude::StakeKey},
transaction::{
DRTransaction, StakeTransaction, Transaction, UnstakeTransaction, VTTransaction,
Expand Down Expand Up @@ -138,6 +139,11 @@ impl Handler<EpochNotification<EveryEpochPayload>> for ChainManager {
protocol.current_version = get_protocol_version(self.current_epoch);
}

// Update the global protocol version state if necessary
if get_protocol_version(self.current_epoch) != get_protocol_version(None) {
refresh_protocol_version(current_epoch);
}

match self.sm_state {
StateMachine::WaitingConsensus => {
if let Some(chain_info) = &self.chain_state.chain_info {
Expand Down

0 comments on commit 27a580b

Please sign in to comment.