From 10e5563d4502f77f1d2d1e9e435a447e89f9d817 Mon Sep 17 00:00:00 2001 From: Kashiko Koibumi Date: Tue, 28 May 2024 13:40:17 +0900 Subject: [PATCH] misc fixes to run with Python3; part 3 --- src/network/bmproto.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/network/bmproto.py b/src/network/bmproto.py index c051c252..0d6261a4 100644 --- a/src/network/bmproto.py +++ b/src/network/bmproto.py @@ -347,7 +347,7 @@ class BMProto(AdvancedDispatcher, ObjectTracker): if now < self.skipUntil: return True for i in items: - self.pendingUpload[str(i)] = now + self.pendingUpload[i] = now return True def _command_inv(self, dandelion=False): @@ -366,7 +366,7 @@ class BMProto(AdvancedDispatcher, ObjectTracker): if dandelion and not state.dandelion_enabled: return True - for i in map(str, items): + for i in items: if i in state.Inventory and not state.Dandelion.hasHash(i): continue if dandelion and not state.Dandelion.hasHash(i): @@ -456,11 +456,10 @@ class BMProto(AdvancedDispatcher, ObjectTracker): """Incoming addresses, process them""" # not using services for seenTime, stream, _, ip, port in self._decode_addr(): - ip = str(ip) if ( stream not in network.connectionpool.pool.streams # FIXME: should check against complete list - or ip.startswith('bootstrap') + or ip.decode("utf-8", "replace").startswith('bootstrap') ): continue decodedIP = protocol.checkIPAddress(ip)