started work on base64 transporting

This commit is contained in:
Kevin Froman 2018-04-22 20:43:17 -05:00
parent 4ff6baa279
commit 89f1b11dac
No known key found for this signature in database
GPG key ID: 0D414D0FE405B63B
5 changed files with 54 additions and 11 deletions

View file

@ -258,7 +258,7 @@ class Core:
Simply return the data associated to a hash
'''
try:
dataFile = open(self.blockDataLocation + hash + '.dat')
dataFile = open(self.blockDataLocation + hash + '.dat', 'rb')
data = dataFile.read()
dataFile.close()
except FileNotFoundError:
@ -281,8 +281,8 @@ class Core:
pass # TODO: properly check if block is already saved elsewhere
#raise Exception("Data is already set for " + dataHash)
else:
blockFile = open(blockFileName, 'w')
blockFile.write(data.decode())
blockFile = open(blockFileName, 'wb')
blockFile.write(data)
blockFile.close()
conn = sqlite3.connect(self.blockDB)