From 45508538aa2737154d97401f2476ec8828595320 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Fri, 15 May 2020 15:22:25 +0300 Subject: [PATCH] Use one stream in version message for inbound connections --- src/network/bmproto.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/network/bmproto.py b/src/network/bmproto.py index fc6ee92d..b5ae9daf 100644 --- a/src/network/bmproto.py +++ b/src/network/bmproto.py @@ -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())