Skip to content

Commit be93606

Browse files
committed
fix get config 32 and 34 for 1 validator
1 parent 7add95d commit be93606

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
@@ -910,9 +910,9 @@ def GetConfig32(self):
910910
if "public_key:" in line:
911911
validatorAdnlAddr = parse(line, "adnl_addr:x", ')')
912912
pubkey = parse(line, "pubkey:x", ')')
913-
if config32["totalValidators"] > 1:
913+
try:
914914
validatorWeight = int(parse(line, "weight:", ' '))
915-
else:
915+
except ValueError:
916916
validatorWeight = int(parse(line, "weight:", ')'))
917917
buff = dict()
918918
buff["adnlAddr"] = validatorAdnlAddr
@@ -947,9 +947,9 @@ def GetConfig34(self):
947947
if "public_key:" in line:
948948
validatorAdnlAddr = parse(line, "adnl_addr:x", ')')
949949
pubkey = parse(line, "pubkey:x", ')')
950-
if config34["totalValidators"] > 1:
950+
try:
951951
validatorWeight = int(parse(line, "weight:", ' '))
952-
else:
952+
except ValueError:
953953
validatorWeight = int(parse(line, "weight:", ')'))
954954
buff = dict()
955955
buff["adnlAddr"] = validatorAdnlAddr

0 commit comments

Comments
 (0)