diff --git a/onionr/onionrblocks/blockimporter.py b/onionr/onionrblocks/blockimporter.py index 997ef099..dec7c75a 100755 --- a/onionr/onionrblocks/blockimporter.py +++ b/onionr/onionrblocks/blockimporter.py @@ -41,7 +41,7 @@ def importBlockFromData(content): metadata = metas[0] if validatemetadata.validate_metadata(metadata, metas[2]): # check if metadata is valid if crypto.cryptoutils.verify_POW(content): # check if POW is enough/correct - logger.info('Block passed proof, saving.', terminal=True) + logger.info('Imported block passed proof, saving.', terminal=True) try: blockHash = onionrstorage.set_data(content) except onionrexceptions.DiskAllocationReached: diff --git a/onionr/onionrcommands/filecommands.py b/onionr/onionrcommands/filecommands.py index 01c96aef..c475370a 100755 --- a/onionr/onionrcommands/filecommands.py +++ b/onionr/onionrcommands/filecommands.py @@ -50,7 +50,7 @@ def add_file(singleBlock=False, blockType='bin'): logger.info('Adding file... this might take a long time.', terminal=True) try: with open(_get_dir(filename), 'rb') as singleFile: - blockhash = insert(base64.b64encode(singleFile.read()), header=blockType) + blockhash = insert(singleFile.read(), header=blockType) if len(blockhash) > 0: logger.info('File %s saved in block %s' % (filename, blockhash), terminal=True) except Exception as e: @@ -82,7 +82,7 @@ def get_file(): try: with open(fileName, 'wb') as myFile: - myFile.write(base64.b64decode(Block(bHash).bcontent)) + myFile.write(Block(bHash).bcontent) except onionrexceptions.NoDataAvailable: logger.error('That block is not available. Trying again later may work.', terminal=True)