Skip to content

Commit

Permalink
Merge pull request #5808 from multiversx/temp-fix-for-single-key-redu…
Browse files Browse the repository at this point in the history
…ndancy-system

Temporary fix for the single-key redundancy system
  • Loading branch information
iulianpascalau authored Jan 6, 2024
2 parents d51f756 + 6f6778d commit 3e59eae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions consensus/spos/bls/subroundStartRound.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ func (sr *subroundStartRound) initCurrentRound() bool {
sr.ConsensusGroup(),
sr.RoundHandler().Index(),
)
// TODO refactor the usage of the single key & multikey redundancy system
if sr.NodeRedundancyHandler().IsMainMachineActive() {
return false
}
}

leader, err := sr.GetLeader()
Expand Down
4 changes: 2 additions & 2 deletions consensus/spos/bls/subroundStartRound_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ func TestSubroundStartRound_InitCurrentRoundShouldReturnFalseWhenGenerateNextCon
assert.False(t, r)
}

func TestSubroundStartRound_InitCurrentRoundShouldReturnTrueWhenMainMachineIsActive(t *testing.T) {
func TestSubroundStartRound_InitCurrentRoundShouldReturnFalseWhenMainMachineIsActive(t *testing.T) {
t.Parallel()

nodeRedundancyMock := &mock.NodeRedundancyHandlerStub{
Expand All @@ -442,7 +442,7 @@ func TestSubroundStartRound_InitCurrentRoundShouldReturnTrueWhenMainMachineIsAct
srStartRound := *initSubroundStartRoundWithContainer(container)

r := srStartRound.InitCurrentRound()
assert.True(t, r)
assert.False(t, r)
}

func TestSubroundStartRound_InitCurrentRoundShouldReturnFalseWhenGetLeaderErr(t *testing.T) {
Expand Down

0 comments on commit 3e59eae

Please sign in to comment.