Skip to content

Commit bf0bf61

Browse files
authored
Merge pull request #168 from yungwine/mytonctrl2_dev
fix get config 32 and 34 for 1 validator
2 parents 8bcc5be + be93606 commit bf0bf61

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mytoncore/mytoncore.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -911,9 +911,9 @@ def GetConfig32(self):
911911
if "public_key:" in line:
912912
validatorAdnlAddr = parse(line, "adnl_addr:x", ')')
913913
pubkey = parse(line, "pubkey:x", ')')
914-
if config32["totalValidators"] > 1:
914+
try:
915915
validatorWeight = int(parse(line, "weight:", ' '))
916-
else:
916+
except ValueError:
917917
validatorWeight = int(parse(line, "weight:", ')'))
918918
buff = dict()
919919
buff["adnlAddr"] = validatorAdnlAddr
@@ -948,9 +948,9 @@ def GetConfig34(self):
948948
if "public_key:" in line:
949949
validatorAdnlAddr = parse(line, "adnl_addr:x", ')')
950950
pubkey = parse(line, "pubkey:x", ')')
951-
if config34["totalValidators"] > 1:
951+
try:
952952
validatorWeight = int(parse(line, "weight:", ' '))
953-
else:
953+
except ValueError:
954954
validatorWeight = int(parse(line, "weight:", ')'))
955955
buff = dict()
956956
buff["adnlAddr"] = validatorAdnlAddr

0 commit comments

Comments
 (0)