@@ -34,7 +34,7 @@ use stacks_common::util::secp256k1::MessageSignature;
34
34
use stacks_common:: { debug, info, warn} ;
35
35
36
36
use crate :: chainstate:: {
37
- ProposalEvalConfig , SignerChainstateError , SortitionState , SortitionsView ,
37
+ ProposalEvalConfig , SignerChainstateError , SortitionMinerStatus , SortitionState , SortitionsView ,
38
38
} ;
39
39
use crate :: client:: { ClientError , CurrentAndLastSortition , StackerDB , StacksClient } ;
40
40
use crate :: signerdb:: SignerDb ;
@@ -579,6 +579,7 @@ impl LocalStateMachine {
579
579
local_address : StacksAddress ,
580
580
local_supported_signer_protocol_version : u64 ,
581
581
reward_cycle : u64 ,
582
+ sortition_state : & mut Option < SortitionsView > ,
582
583
) {
583
584
// Before we ever access eval...we should make sure to include our own local state machine update message in the evaluation
584
585
let Ok ( mut local_update) =
@@ -682,6 +683,21 @@ impl LocalStateMachine {
682
683
active_signer_protocol_version,
683
684
tx_replay_set,
684
685
} ) ;
686
+
687
+ match new_miner {
688
+ StateMachineUpdateMinerState :: ActiveMiner {
689
+ current_miner_pkh, ..
690
+ } => {
691
+ if let Some ( sortition_state) = sortition_state {
692
+ // if there is a mismatch between the new_miner ad the current sortition view, mark the current miner as invalid
693
+ if current_miner_pkh != sortition_state. cur_sortition . miner_pkh {
694
+ sortition_state. cur_sortition . miner_status =
695
+ SortitionMinerStatus :: InvalidatedBeforeFirstBlock
696
+ }
697
+ }
698
+ }
699
+ StateMachineUpdateMinerState :: NoValidMiner => ( ) ,
700
+ }
685
701
}
686
702
}
687
703
0 commit comments