Changeset - 4f3ff4c311f2
[Not reviewed]
default
0 2 0
Laman - 7 years ago 2018-01-24 10:58:18

bugfix: server failed to update its stored tree
2 files changed with 4 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/config.py
Show inline comments
 
@@ -21,7 +21,7 @@ conf=dict()
 
if os.path.isfile(configFile):
 
	with open(configFile) as f: conf=json.load(f)
 

	
 
version=[0,1,0]
 
version=[0,1,1]
 
lowestCompatible=[0,1,0] # tuple is more fitting but json conversion transforms it into a list anyway
 

	
 
hosts=conf.get("hosts",["127.0.0.1"])
src/server.py
Show inline comments
 
@@ -137,10 +137,11 @@ class Server(NetNode):
 
		for (i,k) in enumerate(indices):
 
			if self._lastIndex+1!=k:
 
				self._dataFile.seek(k*self.BLOCK_SIZE)
 
			self._dataFile.write(binData[i*self.BLOCK_SIZE:(i+1)*self.BLOCK_SIZE])
 
			block=binData[i*self.BLOCK_SIZE:(i+1)*self.BLOCK_SIZE]
 
			self._dataFile.write(block)
 
			self._lastIndex=k
 
			if self._treeFile:
 
				self._newLeaves[k+self._tree.leafStart]=hashBlock(binData)
 
				self._newLeaves[k+self._tree.leafStart]=hashBlock(block)
 

	
 
		return ({"command": "ack", "index": indices},)
 

	
0 comments (0 inline, 0 general)