Skip to content

Commit a262210

Browse files
authored
Merge pull request #354 from yungwine/dev
Dev
2 parents 79d45ed + 5d63651 commit a262210

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

modules/utilities.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ def print_election_entries_list(self, args):
302302

303303
def print_validator_list(self, args):
304304
past = "past" in args
305-
data = self.ton.GetValidatorsList(past=past)
305+
fast = "fast" in args
306+
data = self.ton.GetValidatorsList(past=past, fast=fast)
306307
if data is None or len(data) == 0:
307308
print("No data")
308309
return
@@ -311,8 +312,8 @@ def print_validator_list(self, args):
311312
print(text)
312313
else:
313314
table = list()
314-
table += [["ADNL", "Pubkey", "Wallet", "Efficiency", "Online"]]
315-
for item in data:
315+
table += [["id", "ADNL", "Pubkey", "Wallet", "Efficiency", "Online"]]
316+
for i, item in enumerate(data):
316317
adnl = item.get("adnlAddr")
317318
pubkey = item.get("pubkey")
318319
walletAddr = item.get("walletAddr")
@@ -330,7 +331,7 @@ def print_validator_list(self, args):
330331
online = bcolors.green_text("true")
331332
if not online:
332333
online = bcolors.red_text("false")
333-
table += [[adnl, pubkey, walletAddr, efficiency, online]]
334+
table += [[str(i), adnl, pubkey, walletAddr, efficiency, online]]
334335
print_table(table)
335336
# end define
336337

mytoncore/mytoncore.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2491,6 +2491,8 @@ def CheckValidators(self, start, end):
24912491
electionId = start
24922492
complaints = self.GetComplaints(electionId)
24932493
valid_complaints = self.get_valid_complaints(complaints, electionId)
2494+
voted_complaints = self.GetVotedComplaints(complaints)
2495+
voted_complaints_pseudohashes = [complaint['pseudohash'] for complaint in voted_complaints.values()]
24942496
data = self.GetValidatorsLoad(start, end, saveCompFiles=True)
24952497
fullElectorAddr = self.GetFullElectorAddr()
24962498
wallet = self.GetValidatorWallet(mode="vote")
@@ -2510,7 +2512,7 @@ def CheckValidators(self, start, end):
25102512
var2 = item.get("var2")
25112513
pubkey = item.get("pubkey")
25122514
pseudohash = pubkey + str(electionId)
2513-
if pseudohash in valid_complaints:
2515+
if pseudohash in valid_complaints or pseudohash in voted_complaints_pseudohashes: # do not create complaints that already created or voted by ourself
25142516
continue
25152517
if item['id'] >= config['mainValidators']: # do not create complaints for non-masterchain validators
25162518
continue

0 commit comments

Comments
 (0)