check for bytes hash type in setData

master
Kevin Froman 2018-01-28 20:14:46 -06:00
parent 55aa889bd9
commit 0ca84c9759
No known key found for this signature in database
GPG Key ID: 0D414D0FE405B63B
1 changed files with 2 additions and 0 deletions

View File

@ -162,6 +162,8 @@ class Core:
hasher = hashlib.sha3_256()
hasher.update(data)
dataHash = hasher.hexdigest()
if type(dataHash) is bytes:
dataHash = dataHash.decode()
blockFileName = self.blockDataLocation + dataHash + '.dat'
if os.path.exists(blockFileName):
raise Exception("Data is already set for " + dataHash)