fix(p2p): trying to parse None on timeouts/ctrl-c's updating whitelist
@@ -274,7 +274,11 @@ class ConnectionsManager:
def _update_whitelist_err(self, *args: Any, **kwargs: Any) -> None:
self.log.error('update whitelist failed', args=args, kwargs=kwargs)
- def _update_whitelist_cb(self, body: bytes) -> None:
+ def _update_whitelist_cb(self, body: Optional[bytes]) -> None:
+ if body is None:
+ self.log.warn('update whitelist got no response')
+ return
+ else:
self.log.info('update whitelist got response')
try:
text = body.decode()
