Skip to content

Commit

Permalink
check bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
nkryuchkov committed Oct 26, 2024
1 parent 74c19ef commit df6e732
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions operator/validator/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,8 @@ func (c *controller) StartValidators() {
if c.operatorDataStore.GetOperatorID() != 0 && share.BelongsToOperator(c.operatorDataStore.GetOperatorID()) {
ownShares = append(ownShares, share)
}
if activeSubnets[commons.CommitteeSubnet(share.CommitteeID())] != 0 {
subnet := commons.CommitteeSubnet(share.CommitteeID())
if uint64(len(activeSubnets)) >= subnet && activeSubnets[subnet] != 0 {
pubKeysToFetch = append(pubKeysToFetch, share.ValidatorPubKey[:])
}
}
Expand Down Expand Up @@ -1147,7 +1148,8 @@ func (c *controller) UpdateValidatorMetaDataLoop() {
return true
}

if activeSubnets[commons.CommitteeSubnet(share.CommitteeID())] == 0 {
subnet := commons.CommitteeSubnet(share.CommitteeID())
if uint64(len(activeSubnets)) < subnet || activeSubnets[subnet] == 0 {
return true
}

Expand Down

0 comments on commit df6e732

Please sign in to comment.