diff --git a/minode/connection.py b/minode/connection.py index fc470b0..23a2d90 100644 --- a/minode/connection.py +++ b/minode/connection.py @@ -278,10 +278,9 @@ class ConnectionBase(threading.Thread): self.send_queue.put(message.Addr(addr)) if shared.objects: - for chunk in shared.objects.vectors_to_send(10000): - # We limit size of inv messaged to 10000 entries - # because they might time out - # in very slow networks (I2P) + for chunk in shared.objects.biginv_chunks(10000): + # We limit size of inv messages to 10000 entries + # because they might time out in very slow networks (I2P) self.send_queue.put(message.Inv(chunk)) self.status = 'fully_established' diff --git a/minode/sql.py b/minode/sql.py index 1563e08..8bbcfdb 100644 --- a/minode/sql.py +++ b/minode/sql.py @@ -149,7 +149,7 @@ class Inventory(): self._pending.update(vectors) return vectors - def vectors_to_send(self, chunk_size=10000, stream=None): + def biginv_chunks(self, chunk_size=10000, stream=None): if stream is None: stream = shared.stream now = int(time.time()) diff --git a/minode/tests/test_objects.py b/minode/tests/test_objects.py index dddbc18..fe2b825 100644 --- a/minode/tests/test_objects.py +++ b/minode/tests/test_objects.py @@ -16,7 +16,7 @@ from minode import sql, shared, structure # + get # + filter # = select -# + vectors_to_send +# + biginv_chunks class TestObjects(): @@ -46,7 +46,7 @@ class TestObjects(): self.assertEqual(obj.vector, obj1.vector) self.assertEqual(obj.data, obj1.data) - def test_vectors_to_send(self): + def test_biginv_chunks(self): """Check vectors_to_send method""" needed = set() for _ in range(10): @@ -66,9 +66,9 @@ class TestObjects(): needed.add(obj.vector) self.assertEqual( - set(next(self.objects.vectors_to_send(stream=4))), needed) + set(next(self.objects.biginv_chunks(stream=4))), needed) self.assertTrue( - set(next(self.objects.vectors_to_send())).difference(needed)) + set(next(self.objects.biginv_chunks())).difference(needed)) def test_filter(self): """Check the objects filtering"""