Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Commit c8024b8

Browse files
authored
relax validate intention check
1 parent 7282f97 commit c8024b8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/common/src/constraints/ValidityChecks.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,13 @@ export const checkValidateIntention = async (
4747
): Promise<boolean> => {
4848
try {
4949
const validators = await chaindata.getValidators();
50-
if (!validators.includes(Util.formatAddress(candidate?.stash, config))) {
51-
await setValidateIntentionValidity(candidate.stash, false);
52-
return false;
53-
} else {
50+
if(!validators?.length || validators.includes(Util.formatAddress(candidate?.stash, config))){
5451
await setValidateIntentionValidity(candidate.stash, true);
5552
return true;
5653
}
57-
return true;
54+
55+
await setValidateIntentionValidity(candidate.stash, false);
56+
return false;
5857
} catch (e) {
5958
logger.error(`Error checking validate intention: ${e}`, constraintsLabel);
6059
return false;

0 commit comments

Comments
 (0)