Skip to content

Commit 5d63651

Browse files
committed
do not create complaints that already been voted
1 parent b379a02 commit 5d63651

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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)