set dataSaved when it should have already been

This commit is contained in:
Kevin Froman 2018-01-28 20:39:34 -06:00
parent aaecd0adaf
commit b4d61d3598
No known key found for this signature in database
GPG Key ID: 0D414D0FE405B63B
1 changed files with 7 additions and 7 deletions

View File

@ -166,18 +166,18 @@ class Core:
dataHash = dataHash.decode()
blockFileName = self.blockDataLocation + dataHash + '.dat'
if os.path.exists(blockFileName):
return # to do, properly check if block is already saved elsewhere
raise Exception("Data is already set for " + dataHash)
pass # to do, properly check if block is already saved elsewhere
#raise Exception("Data is already set for " + dataHash)
else:
blockFile = open(blockFileName, 'w')
blockFile.write(data.decode())
blockFile.close()
conn = sqlite3.connect(self.blockDB)
c = conn.cursor()
c.execute("UPDATE hashes set dataSaved=1 where hash = '" + dataHash + "';")
conn.commit()
conn.close()
conn = sqlite3.connect(self.blockDB)
c = conn.cursor()
c.execute("UPDATE hashes set dataSaved=1 where hash = '" + dataHash + "';")
conn.commit()
conn.close()
return dataHash