From b4d61d35983d4140fb4718e7217e166b3c6cbffa Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Sun, 28 Jan 2018 20:39:34 -0600 Subject: [PATCH] set dataSaved when it should have already been --- onionr/core.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/onionr/core.py b/onionr/core.py index 5a751fe3..d0a9bf0e 100644 --- a/onionr/core.py +++ b/onionr/core.py @@ -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