Skip to content

Commit

Permalink
Update XDCValidator.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
GalaxySciTech committed Aug 7, 2024
1 parent e190cc3 commit 3ae7fcf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contracts/validator/src/contracts/XDCValidator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ contract XDCValidator {
if (isOwnerNow) {
uint j = 0;
uint count = 0;
address[] memory allMasternodes = new address[](
address[] memory allInvalidMasternodes = new address[](
candidates.length
);
address[] memory newCandidates = new address[](
Expand All @@ -376,7 +376,7 @@ contract XDCValidator {
if (getCandidateOwner(candidate) == _owner) {
// logic to remove cap.
candidateCount = candidateCount.sub(1);
allMasternodes[count++] = candidate;
allInvalidMasternodes[count++] = candidate;
invalidCandidate[candidate] = true;
delete validatorsState[candidate];
delete KYCString[_owner];
Expand All @@ -390,12 +390,12 @@ contract XDCValidator {
// Resize the array.
assembly {
mstore(newCandidates, j)
mstore(allMasternodes, count)
mstore(allInvalidMasternodes, count)
}
candidates = newCandidates;

removeOwnerByIndex(ownerIndex);
emit InvalidatedNode(_owner, allMasternodes);
emit InvalidatedNode(_owner, allInvalidMasternodes);
}
}
}
Expand Down

0 comments on commit 3ae7fcf

Please sign in to comment.