Don't open new connections if have enough (excess == 0)
This commit is contained in:
parent
4b8bd3bf9e
commit
98d06c206b
|
@ -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:
|
||||||
|
|
Reference in New Issue
Block a user