Skip to content

Commit 302c498

Browse files
committed
sort complaints
Sort complaints by their creation time so all validators can vote for same complaints as they are in determenistic order
1 parent 00c6c9f commit 302c498

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mytoncore/mytoncore.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2280,6 +2280,9 @@ def GetComplaints(self, electionId=None, past=False):
22802280
complaints[chash] = item
22812281
#end for
22822282

2283+
# sort complaints by their creation time and hash
2284+
complaints = dict(sorted(complaints.items(), key=lambda item: (item[1]["createdTime"], item[0])))
2285+
22832286
# Set buffer
22842287
self.SetFunctionBuffer(bname, complaints)
22852288

0 commit comments

Comments
 (0)