diff --git a/src/client.py b/src/client.py --- a/src/client.py +++ b/src/client.py @@ -1,9 +1,11 @@ -from hashtree import HashTree -import collections +import collections import socket import logging as log +from datetime import datetime import config as conf +from util import progress +from hashtree import HashTree from networkers import NetworkReader,NetworkWriter @@ -29,6 +31,7 @@ class Client: self.filename=filename def negotiate(self): + print(datetime.now(), "initializing...") localTree=HashTree.fromFile(self.filename) blocksToTransfer=[] nodeStack=collections.deque([0]) # root @@ -39,6 +42,7 @@ class Client: outcoming.writeMsg(jsonData) # determine which blocks to send + print(datetime.now(), "negotiating:") while len(nodeStack)>0: with Connection() as (incoming,outcoming): i=nodeStack.pop() @@ -52,7 +56,10 @@ class Client: if 2*i+3