diff --git a/src/client.py b/src/client.py --- a/src/client.py +++ b/src/client.py @@ -74,7 +74,7 @@ class Client(NetNode): progress=Progress(localTree.leafCount) while len(nodeStack)>0: indices=[] - for i in range(conf.batchSize): + for i in range(conf.batchSize.hash): indices.append(nodeStack.pop()) if len(nodeStack)==0: break self._outcoming.writeMsg({"command":"req", "index":indices, "dataType":"hash"}) @@ -111,10 +111,10 @@ class Client(NetNode): print(datetime.now(), "sending data:") progress=Progress(len(blocksToTransfer)) - for k in range(0,len(blocksToTransfer),conf.batchSize): + for k in range(0,len(blocksToTransfer),conf.batchSize.data): indices=[] blocks=[] - for j in range(conf.batchSize): + for j in range(conf.batchSize.data): if k+j>=len(blocksToTransfer): break i2=blocksToTransfer[k+j] if i1+1!=i2: @@ -148,8 +148,8 @@ class Client(NetNode): print(datetime.now(), "receiving data:") progress=Progress(len(blocksToTransfer)) - for k in range(0,len(blocksToTransfer),conf.batchSize): - indices=blocksToTransfer[k:k+conf.batchSize] + for k in range(0,len(blocksToTransfer),conf.batchSize.data): + indices=blocksToTransfer[k:k+conf.batchSize.data] self._outcoming.writeMsg({"command":"req", "index":indices, "dataType":"data"}) jsonData,binData=self._incoming.readMsg() assert jsonData["command"]=="send" and jsonData["index"]==indices and jsonData["dataType"]=="data", jsonData