diff --git a/src/communicatorutils/uploadblocks/__init__.py b/src/communicatorutils/uploadblocks/__init__.py index 11b67e0a..0440c526 100755 --- a/src/communicatorutils/uploadblocks/__init__.py +++ b/src/communicatorutils/uploadblocks/__init__.py @@ -67,10 +67,11 @@ def upload_blocks_from_communicator(comm_inst: 'OnionrCommunicatorDaemon'): session = session_manager.add_session(bl) for _ in range(min(len(kv.get('onlinePeers')), 6)): try: - peer = onlinepeers.pick_online_peer(kv) - if peer in kv.get('plaintextDisabledPeers'): - logger.info(f"Cannot upload plaintext block to peer that denies it {peer}") # noqa - continue + if not block.Block(bl).isEncrypted(): + peer = onlinepeers.pick_online_peer(kv) + if peer in kv.get('plaintextDisabledPeers'): + logger.info(f"Cannot upload plaintext block to peer that denies it {peer}") # noqa + continue except onionrexceptions.OnlinePeerNeeded: continue try: diff --git a/src/onionrblocks/onionrblockapi.py b/src/onionrblocks/onionrblockapi.py index 85f0384c..27bcac8f 100755 --- a/src/onionrblocks/onionrblockapi.py +++ b/src/onionrblocks/onionrblockapi.py @@ -66,6 +66,7 @@ class Block: self.signer = None self.validSig = False self.autoDecrypt = decrypt + self.claimedTime = None self.update() diff --git a/src/onionrstorage/__init__.py b/src/onionrstorage/__init__.py index 94a1b27e..37ccc2c6 100755 --- a/src/onionrstorage/__init__.py +++ b/src/onionrstorage/__init__.py @@ -104,7 +104,7 @@ def getData(bHash): fileLocation = '%s/%s%s' % ( block_data_location, bHash, BLOCK_EXPORT_FILE_EXT) - not_found_msg = "Block data not found for: " + not_found_msg = "Block data not found for: " + str(bHash) if os.path.exists(fileLocation): with open(fileLocation, 'rb') as block: ret_data = block.read() @@ -112,5 +112,5 @@ def getData(bHash): ret_data = _dbFetch(bHash) if ret_data is None: - raise onionrexceptions.NoDataAvailable(not_found_msg + str(bHash)) + raise onionrexceptions.NoDataAvailable(not_found_msg) return ret_data