Copy recent messages before cleaning them
This commit is contained in:
		@@ -669,7 +669,7 @@ class User(Peer):
 | 
				
			|||||||
        Remove messages which are overdue (older than 2 minutes) from the inundation dictionnary.
 | 
					        Remove messages which are overdue (older than 2 minutes) from the inundation dictionnary.
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
        self.data_lock.acquire()
 | 
					        self.data_lock.acquire()
 | 
				
			||||||
        for key in self.recent_messages:
 | 
					        for key in self.recent_messages.copy():
 | 
				
			||||||
            if time.time() - self.recent_messages[key][1] > 120:
 | 
					            if time.time() - self.recent_messages[key][1] > 120:
 | 
				
			||||||
                self.recent_messages.pop(key)
 | 
					                self.recent_messages.pop(key)
 | 
				
			||||||
        self.data_lock.release()
 | 
					        self.data_lock.release()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user