diff --git a/src/Connection/Connection.py b/src/Connection/Connection.py index 601bc48d0..12fcd870c 100644 --- a/src/Connection/Connection.py +++ b/src/Connection/Connection.py @@ -360,7 +360,7 @@ def getHandshakeInfo(self): else: peer_id = self.server.peer_id # Setup peer lock from requested onion address - if self.handshake + if self.handshake: if self.handshake.get("target_ip", "").endswith(".onion") and self.server.tor_manager.start_onions: self.target_onion = self.handshake.get("target_ip").replace(".onion", "") # My onion address if not self.server.tor_manager.site_onions.values(): @@ -439,7 +439,7 @@ def setHandshake(self, handshake): if crypt: self.crypt = crypt - if self.type == "in" + if self.type == "in": if handshake.get("onion") and not self.ip_type == "onion": # Set incoming connection's onion address if self.server.ips.get(self.ip) == self: del self.server.ips[self.ip] diff --git a/src/I2P/I2PManager.py b/src/I2P/I2PManager.py index 83c9be6ca..51fb86333 100644 --- a/src/I2P/I2PManager.py +++ b/src/I2P/I2PManager.py @@ -1,6 +1,6 @@ import logging -from gevent.coros import RLock +from gevent.lock import RLock from gevent.server import StreamServer from gevent.pool import Pool from http.client import HTTPConnection