fixed exception caused by probably check for missing block

master
Kevin Froman 2018-04-22 23:17:16 -05:00
parent 0dc6a0b6c5
commit 3e8d76e246
1 changed files with 4 additions and 1 deletions

View File

@ -198,7 +198,10 @@ class API:
elif action == 'getData':
if self._utils.validateHash(data):
if not os.path.exists('data/blocks/' + data + '.db'):
try:
resp = base64.b64encode(self._core.getData(data))
except TypeError:
resp = ""
if resp == False:
abort(404)
resp = ""