hopefully fixed block sync issue

This commit is contained in:
Kevin Froman 2018-08-16 19:02:14 -05:00
parent cb90c24e64
commit 5b20930d5c
3 changed files with 10 additions and 3 deletions

View file

@ -474,7 +474,7 @@ class API:
elif action == 'getData':
resp = ''
if self._utils.validateHash(data):
if not os.path.exists('data/blocks/' + data + '.db'):
if os.path.exists('data/blocks/' + data + '.dat'):
block = Block(hash=data.encode(), core=self._core)
resp = base64.b64encode(block.getRaw().encode()).decode()
if len(resp) == 0:

View file

@ -216,6 +216,7 @@ class OnionrCommunicatorDaemon:
logger.warn('POW failed for block ' + blockHash)
else:
logger.warn('Metadata for ' + blockHash + ' is invalid.')
self._core._blacklist.addToDB(blockHash)
else:
# if block didn't meet expected hash
tempHash = self._core._crypto.sha3Hash(content) # lazy hack, TODO use var