@@ -48,19 +48,23 @@ type ConsensusState struct {
4848 * roundStatus
4949
5050 mutState sync.RWMutex
51+
52+ redundancyHandler consensus.NodeRedundancyHandler
5153}
5254
5355// NewConsensusState creates a new ConsensusState object
5456func NewConsensusState (
5557 roundConsensus * roundConsensus ,
5658 roundThreshold * roundThreshold ,
5759 roundStatus * roundStatus ,
60+ redundancyHandler consensus.NodeRedundancyHandler ,
5861) * ConsensusState {
5962
6063 cns := ConsensusState {
61- roundConsensus : roundConsensus ,
62- roundThreshold : roundThreshold ,
63- roundStatus : roundStatus ,
64+ roundConsensus : roundConsensus ,
65+ roundThreshold : roundThreshold ,
66+ roundStatus : roundStatus ,
67+ redundancyHandler : redundancyHandler ,
6468 }
6569
6670 cns .ResetConsensusState ()
@@ -266,7 +270,7 @@ func (cns *ConsensusState) CanDoSubroundJob(currentSubroundId int) bool {
266270// CanProcessReceivedMessage method returns true if the message received can be processed and false otherwise
267271func (cns * ConsensusState ) CanProcessReceivedMessage (cnsDta * consensus.Message , currentRoundIndex int64 ,
268272 currentSubroundId int ) bool {
269- if cns .IsNodeSelf (string (cnsDta .PubKey )) {
273+ if cns .IsNodeSelf (string (cnsDta .PubKey )) && ShouldConsiderSelfKeyInConsensus ( cns . redundancyHandler ) {
270274 return false
271275 }
272276
0 commit comments