do not add block in addblock function if it already is added

master
Kevin Froman 2018-01-28 21:45:43 -06:00
parent e5a3a4650e
commit 71bff27245
1 changed files with 2 additions and 0 deletions

View File

@ -134,6 +134,8 @@ class Core:
'''add a hash value to the block db (should be in hex format)'''
if not os.path.exists(self.blockDB):
raise Exception('Block db does not exist')
if self._utils.hasBlock(newHash):
return
conn = sqlite3.connect(self.blockDB)
c = conn.cursor()
currentTime = math.floor(time.time())