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
14 changes: 8 additions & 6 deletions mytoncore/mytoncore.py
Original file line number Diff line number Diff line change
Expand Up @@ -1624,7 +1624,7 @@ def CreateWallet(self, name, workchain=0, version="v1", **kwargs):
if os.path.isfile(wallet_path + ".pk") and "v3" not in version:
self.local.add_log("CreateWallet error: Wallet already exists: " + name, "warning")
else:
fift_args = self.get_new_wallet_fift_args(version, workchain=workchain,
fift_args = self.get_new_wallet_fift_args(version, workchain=workchain,
wallet_path=wallet_path, subwallet=subwallet)
result = self.fift.Run(fift_args)
if "Creating new" not in result:
Expand Down Expand Up @@ -1681,7 +1681,7 @@ def import_wallet_with_version(self, key, version, **kwargs):
wallet_path = self.walletsDir + wallet_name
with open(wallet_path + ".pk", 'wb') as file:
file.write(pk_bytes)
fift_args = self.get_new_wallet_fift_args(version, workchain=workchain,
fift_args = self.get_new_wallet_fift_args(version, workchain=workchain,
wallet_path=wallet_path, subwallet=subwallet)
result = self.fift.Run(fift_args)
if "Creating new" not in result:
Expand Down Expand Up @@ -2310,6 +2310,7 @@ def get_valid_complaints(self, complaints: dict, election_id: int):
continue

exists = False
vload = None
for item in validators_load.values():
if 'fileName' not in item:
continue
Expand All @@ -2319,15 +2320,16 @@ def get_valid_complaints(self, complaints: dict, election_id: int):
pseudohash = pubkey + str(election_id)
if pseudohash == complaint['pseudohash']:
exists = True
vid = item['id']
vload = item
break

if not exists:
self.local.add_log(f"complaint {complaint['hash_hex']} declined: complaint info was not found, probably it's wrong", "info")
continue

if vid >= config32['mainValidators']:
self.local.add_log(f"complaint {complaint['hash_hex']} declined: complaint created for non masterchain validator", "info")
if (vload["id"] >= config32['mainValidators'] and
vload["masterBlocksCreated"] + vload["workBlocksCreated"] > 0):
self.local.add_log(f"complaint {complaint['hash_hex']} declined: complaint created for non masterchain validator that created more than zero blocks", "info")
continue

# check complaint fine value
Expand Down Expand Up @@ -2524,7 +2526,7 @@ def CheckValidators(self, start, end):
pseudohash = pubkey + str(electionId)
if pseudohash in valid_complaints or pseudohash in voted_complaints_pseudohashes: # do not create complaints that already created or voted by ourself
continue
if item['id'] >= config['mainValidators']: # do not create complaints for non-masterchain validators
if item['id'] >= config['mainValidators'] and item["masterBlocksCreated"] + item["workBlocksCreated"] > 0: # create complaints for non-masterchain validators only if they created 0 blocks
continue
# Create complaint
fileName = self.remove_proofs_from_complaint(fileName)
Expand Down