onionr now removes and ignores blocks it cant get after a long time, added removeblock function

This commit is contained in:
Kevin Froman 2018-04-23 01:03:10 -05:00
parent db2babac29
commit 0db21e2c32
No known key found for this signature in database
GPG key ID: 0D414D0FE405B63B
3 changed files with 43 additions and 6 deletions

View file

@ -154,6 +154,22 @@ class Core:
return True
else:
return False
def removeBlock(self, block):
'''
remove a block from this node
'''
if self._utils.validateHash(block):
conn = sqlite3.connect(self.blockDB)
c = conn.cursor()
t = (block,)
c.execute('Delete from hashes where hash=?;', t)
conn.commit()
conn.close()
try:
os.remove('data/blocks/' + block + '.dat')
except FileNotFoundError:
pass
def createAddressDB(self):
'''