do not add block in addblock function if it already is added
This commit is contained in:
parent
e5a3a4650e
commit
71bff27245
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user