mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Check if entry exists in dictionary before delete
This commit is contained in:
@ -96,7 +96,8 @@ class MessageCache:
|
||||
last_entries: List[CacheEntry] = self.history[len(self.history) - 1]
|
||||
|
||||
for entry in last_entries:
|
||||
del self.msgs[entry.mid]
|
||||
if entry.mid in self.msgs:
|
||||
del self.msgs[entry.mid]
|
||||
|
||||
i: int = len(self.history) - 2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user