diff --git a/server.py b/server.py old mode 100644 new mode 100755 --- a/server.py +++ b/server.py @@ -36,7 +36,11 @@ outcoming=networkWriter.input while True: jsonData,binData=incoming.get(timeout=2) - if jsonData["command"]=="req": # !! index out of range + if jsonData["command"]=="init": + assert jsonData["blockSize"]==localTree.BLOCK_SIZE + assert jsonData["blockCount"]==localTree.leafCount + + elif jsonData["command"]=="req": # !! index out of range print("received request for node #{0}".format(jsonData["index"])) nodeHash=localTree.store[jsonData["index"]]