Don't open new connections if have enough (excess == 0)

This commit is contained in:
Dmitri Bogomolov 2021-05-31 23:28:39 +03:00
parent 4b8bd3bf9e
commit 98d06c206b
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -290,7 +290,7 @@ class BMConnectionPool(object):
pending = len(self.outboundConnections) - established_num pending = len(self.outboundConnections) - established_num
excess = established_num - BMConfigParser().safeGetInt( excess = established_num - BMConfigParser().safeGetInt(
'bitmessagesettings', 'maxoutboundconnections') 'bitmessagesettings', 'maxoutboundconnections')
if excess > 0: if excess >= 0:
for _ in range(excess): for _ in range(excess):
established.pop().handle_close() established.pop().handle_close()
else: else: