Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions mytoncore/mytoncore.py
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,8 @@ def SendFile(self, filePath, wallet=None, **kwargs):
timeout = kwargs.get("timeout", 30)
remove = kwargs.get("remove", True)
duplicateSendfile = self.local.db.get("duplicateSendfile", True)
duplicateApi = self.local.db.get("duplicateApi", False)
telemetry = self.local.db.get("sendTelemetry", False)
duplicateApi = self.local.db.get("duplicateApi", telemetry)
if not os.path.isfile(filePath):
raise Exception("SendFile error: no such file '{filePath}'".format(filePath=filePath))
if timeout and wallet:
Expand Down Expand Up @@ -1911,12 +1912,13 @@ def MoveCoinsFromHW(self, wallet, destList, **kwargs):

def GetValidatorKey(self):
vconfig = self.GetValidatorConfig()
for validator in vconfig["validators"]:
validators = sorted(vconfig["validators"], key=lambda i: i['election_date'], reverse=True)
for validator in validators:
validatorId = validator["id"]
key_bytes = base64.b64decode(validatorId)
validatorKey = key_bytes.hex().upper()
timestamp = get_timestamp()
if timestamp > validator["election_date"]:
if validator["election_date"] < timestamp < validator["expire_at"]:
return validatorKey
raise Exception("GetValidatorKey error: validator key not found. Are you sure you are a validator?")
#end define
Expand Down