diff --git a/src/client.py b/src/client.py --- a/src/client.py +++ b/src/client.py @@ -59,24 +59,30 @@ class Client: print(datetime.now(), "negotiating:") progress=Progress(localTree.leafCount) while len(nodeStack)>0: - i=nodeStack.pop() - self._outcoming.writeMsg({"command":"req", "index":i, "dataType":"hash"}) + indices=[] + for i in range(256): + indices.append(nodeStack.pop()) + if len(nodeStack)==0: break + indices.sort() + self._outcoming.writeMsg({"command":"req", "index":indices, "dataType":"hash"}) jsonData,binData=self._incoming.readMsg() - assert jsonData["index"]==i + assert jsonData["index"]==indices assert jsonData["dataType"]=="hash" - stats.logExchangedNode() + stats.logExchangedNode(len(indices)) - if localTree.store[i]!=binData: - if 2*i+3