Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
🐛 RegisterMainchainCommand.verify throws if aggregate BFT weight exce…
Browse files Browse the repository at this point in the history
…eds MAX_UINT64
  • Loading branch information
has5aan committed Aug 1, 2023
1 parent 3d369e9 commit 9e6e59f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ export class RegisterMainchainCommand extends BaseInteroperabilityCommand<Sidech
};
}

totalWeight += currentValidator.bftWeight;

if (totalWeight > MAX_UINT64) {
return {
status: VerifyStatus.FAIL,
error: new Error('Total BFT weight exceeds maximum value.'),
};
}

totalWeight += currentValidator.bftWeight;
}

if (mainchainCertificateThreshold < totalWeight / BigInt(3) + BigInt(1)) {
Expand Down

0 comments on commit 9e6e59f

Please sign in to comment.