DHT bugfix: failures tracking should be bound to 2048 LRU cache size

This commit is contained in:
Victor Shyba 2021-12-10 03:04:55 -03:00
parent 7ed807e41b
commit 030e407584

View file

@ -29,7 +29,7 @@ class PeerManager:
self._loop = loop
self._rpc_failures: typing.Dict[
typing.Tuple[str, int], typing.Tuple[typing.Optional[float], typing.Optional[float]]
] = {}
] = LRUCache(2048)
self._last_replied: typing.Dict[typing.Tuple[str, int], float] = LRUCache(2048)
self._last_sent: typing.Dict[typing.Tuple[str, int], float] = LRUCache(2048)
self._last_requested: typing.Dict[typing.Tuple[str, int], float] = LRUCache(2048)