MCPcopy Index your code
hub / github.com/Bitmessage/PyBitmessage / getConnectionByAddr

Method getConnectionByAddr

src/network/connectionpool.py:38–53  ·  view source on GitHub ↗
(self, addr)

Source from the content-addressed store, hash-verified

36 self.streams.append(streamNumber)
37
38 def getConnectionByAddr(self, addr):
39 if addr in self.inboundConnections:
40 return self.inboundConnections[addr]
41 try:
42 if addr.host in self.inboundConnections:
43 return self.inboundConnections[addr.host]
44 except AttributeError:
45 pass
46 if addr in self.outboundConnections:
47 return self.outboundConnections[addr]
48 try:
49 if addr.host in self.udpSockets:
50 return self.udpSockets[addr.host]
51 except AttributeError:
52 pass
53 raise KeyError
54
55 def isAlreadyConnected(self, nodeid):
56 for i in self.inboundConnections.values() + self.outboundConnections.values():

Callers 2

runMethod · 0.80
runMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected