1212
1313# magic imports!
1414import addresses
15- import connectionpool
1615import knownnodes
1716import protocol
1817import state
18+ import connectionpool
1919from bmconfigparser import config
2020from queues import invQueue , objectProcessorQueue , portCheckerQueue
2121from randomtrackingdict import RandomTrackingDict
@@ -540,7 +540,7 @@ def bm_command_version(self):
540540 if not self .isOutbound :
541541 self .append_write_buf (protocol .assembleVersionMessage (
542542 self .destination .host , self .destination .port ,
543- connectionpool .BMConnectionPool () .streams , True ,
543+ connectionpool .pool .streams , True ,
544544 nodeid = self .nodeid ))
545545 logger .debug (
546546 '%(host)s:%(port)i sending version' ,
@@ -596,7 +596,7 @@ def peerValidityChecks(self):
596596 'Closed connection to %s because there is no overlapping'
597597 ' interest in streams.' , self .destination )
598598 return False
599- if connectionpool .BMConnectionPool () .inboundConnections .get (
599+ if connectionpool .pool .inboundConnections .get (
600600 self .destination ):
601601 try :
602602 if not protocol .checkSocksIP (self .destination .host ):
@@ -614,8 +614,8 @@ def peerValidityChecks(self):
614614 # or server full report the same error to counter deanonymisation
615615 if (
616616 Peer (self .destination .host , self .peerNode .port )
617- in connectionpool .BMConnectionPool () .inboundConnections
618- or len (connectionpool .BMConnectionPool () )
617+ in connectionpool .pool .inboundConnections
618+ or len (connectionpool .pool )
619619 > config .safeGetInt (
620620 'bitmessagesettings' , 'maxtotalconnections' )
621621 + config .safeGetInt (
@@ -627,7 +627,7 @@ def peerValidityChecks(self):
627627 'Closed connection to %s due to server full'
628628 ' or duplicate inbound/outbound.' , self .destination )
629629 return False
630- if connectionpool .BMConnectionPool () .isAlreadyConnected (self .nonce ):
630+ if connectionpool .pool .isAlreadyConnected (self .nonce ):
631631 self .append_write_buf (protocol .assembleErrorMessage (
632632 errorText = "I'm connected to myself. Closing connection." ,
633633 fatal = 2 ))
@@ -641,7 +641,7 @@ def peerValidityChecks(self):
641641 @staticmethod
642642 def stopDownloadingObject (hashId , forwardAnyway = False ):
643643 """Stop downloading object *hashId*"""
644- for connection in connectionpool .BMConnectionPool () .connections ():
644+ for connection in connectionpool .pool .connections ():
645645 try :
646646 del connection .objectsNewToMe [hashId ]
647647 except KeyError :
0 commit comments