Use one stream in version message for inbound connections

This commit is contained in:
Dmitri Bogomolov 2020-05-15 15:22:25 +03:00
parent 242a161585
commit 45508538aa
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -542,10 +542,15 @@ class BMProto(AdvancedDispatcher, ObjectTracker):
if not ua_valid:
self.userAgent = '/INVALID:0/'
if not self.isOutbound:
common_streams = self.streams.intersection(
connectionpool.BMConnectionPool().streams)
try: # leave one because of bug in decode_payload_content()
common_streams = [min(common_streams)]
except ValueError:
common_streams = [1]
self.append_write_buf(protocol.assembleVersionMessage(
self.destination.host, self.destination.port,
connectionpool.BMConnectionPool().streams, True,
nodeid=self.nodeid))
common_streams, True, nodeid=self.nodeid))
logger.debug(
'%(host)s:%(port)i sending version',
self.destination._asdict())