From ca8550a206d8c1eed26910573eaeb3fd10e032ae Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Mon, 16 Jan 2017 23:37:25 +0100 Subject: [PATCH] Don't send requests for 0 objects --- src/class_receiveDataThread.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/class_receiveDataThread.py b/src/class_receiveDataThread.py index 2cdd91e6..a569e2d8 100644 --- a/src/class_receiveDataThread.py +++ b/src/class_receiveDataThread.py @@ -415,6 +415,8 @@ class receiveDataThread(threading.Thread): # Send a getdata message to our peer to request the object with the given # hash def sendgetdata(self, hashes): + if len(hashes) == 0: + return logger.debug('sending getdata to retrieve %i objects', len(hashes)) payload = encodeVarint(len(hashes)) + ''.join(hashes) self.sendDataThreadQueue.put((0, 'sendRawData', protocol.CreatePacket('getdata', payload)), False)