Connection lookups invalid data handling
- shouldn't throw an exception if argument is a string rather than Peer
This commit is contained in:
parent
f74f82e54f
commit
c9851b9f41
|
@ -65,12 +65,18 @@ class BMConnectionPool(object):
|
|||
def getConnectionByAddr(self, addr):
|
||||
if addr in self.inboundConnections:
|
||||
return self.inboundConnections[addr]
|
||||
try:
|
||||
if addr.host in self.inboundConnections:
|
||||
return self.inboundConnections[addr.host]
|
||||
except AttributeError:
|
||||
pass
|
||||
if addr in self.outboundConnections:
|
||||
return self.outboundConnections[addr]
|
||||
try:
|
||||
if addr.host in self.udpSockets:
|
||||
return self.udpSockets[addr.host]
|
||||
except AttributeError:
|
||||
pass
|
||||
raise KeyError
|
||||
|
||||
def isAlreadyConnected(self, nodeid):
|
||||
|
|
Loading…
Reference in New Issue
Block a user