Skip to content

Commit 32afd4d

Browse files
committed
dont participate in elections if there is no adnl address in vconfig
1 parent 45b96a7 commit 32afd4d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

mytoncore/mytoncore.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,6 +1436,18 @@ def ElectionEntry(self, args=None):
14361436
if (startWorkTime - now) > self.local.db["participateBeforeEnd"] and \
14371437
(now + self.local.db["periods"]["elections"]) < startWorkTime:
14381438
return
1439+
1440+
vconfig = self.GetValidatorConfig()
1441+
1442+
have_adnl = False
1443+
# Check if ADNL address is in the list
1444+
for a in vconfig.adnl:
1445+
if base64.b64decode(a.id).hex() == adnlAddr:
1446+
have_adnl = True
1447+
break
1448+
if not have_adnl:
1449+
raise Exception('ADNL address is not found')
1450+
14391451
# Check if election entry already completed
14401452
entries = self.GetElectionEntries()
14411453
if adnlAddr in entries:

0 commit comments

Comments
 (0)